1
0
Эх сурвалжийг харах

Adding #if checks for interfaces in BCL.

Bart De Smet 7 жил өмнө
parent
commit
8bf4a3307d

+ 4 - 0
Ix.NET/Source/System.Linq.Async/System/Collections/Generic/IAsyncEnumerable.cs

@@ -5,6 +5,8 @@
 // See https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md for the definition of this interface
 // and the design rationale. (8/30/2017)
 
+#if !HAS_ASYNCENUMERABLE
+
 using System.Threading;
 
 namespace System.Collections.Generic
@@ -23,3 +25,5 @@ namespace System.Collections.Generic
         IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default);
     }
 }
+
+#endif

+ 4 - 0
Ix.NET/Source/System.Linq.Async/System/Collections/Generic/IAsyncEnumerator.cs

@@ -5,6 +5,8 @@
 // See https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md for the definition of this interface
 // and the design rationale. (8/30/2017)
 
+#if !HAS_ASYNCENUMERABLE
+
 using System.Threading.Tasks;
 
 namespace System.Collections.Generic
@@ -30,3 +32,5 @@ namespace System.Collections.Generic
         ValueTask<bool> MoveNextAsync();
     }
 }
+
+#endif

+ 4 - 0
Ix.NET/Source/System.Linq.Async/System/IAsyncDisposable.cs

@@ -5,6 +5,8 @@
 // See https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md for the definition of this interface
 // and the design rationale. (8/30/2017)
 
+#if !HAS_ASYNCDISPOSABLE
+
 using System.Threading.Tasks;
 
 namespace System
@@ -14,3 +16,5 @@ namespace System
         ValueTask DisposeAsync();
     }
 }
+
+#endif