فهرست منبع

Change CSHARP8 for USE_* checks. Enable C# 8.0 for all builds.

Bart De Smet 6 سال پیش
والد
کامیت
ca0a8b53b4
50فایلهای تغییر یافته به همراه349 افزوده شده و 355 حذف شده
  1. 2 7
      Ix.NET/Source/Directory.build.props
  2. 3 2
      Ix.NET/Source/Directory.build.targets
  3. 8 8
      Ix.NET/Source/Playground/Program.cs
  4. 1 1
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Max.cs
  5. 1 1
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Min.cs
  6. 3 3
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/MinBy.cs
  7. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerableHelpers.cs
  8. 9 9
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs
  9. 3 5
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs
  10. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs
  11. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs
  12. 40 40
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs
  13. 8 8
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt
  14. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs
  15. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs
  16. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs
  17. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs
  18. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs
  19. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs
  20. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs
  21. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs
  22. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs
  23. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs
  24. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs
  25. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs
  26. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs
  27. 9 9
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Lookup.cs
  28. 8 8
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs
  29. 8 8
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs
  30. 80 80
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs
  31. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.tt
  32. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs
  33. 5 5
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs
  34. 16 16
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs
  35. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs
  36. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs
  37. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs
  38. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs
  39. 7 7
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs
  40. 40 40
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs
  41. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt
  42. 2 2
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs
  43. 7 7
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs
  44. 6 6
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs
  45. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs
  46. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs
  47. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs
  48. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Utilities.cs
  49. 5 5
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs
  50. 4 4
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs

+ 2 - 7
Ix.NET/Source/Directory.build.props

@@ -16,8 +16,8 @@
     <DebugType>embedded</DebugType>
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
-    <LangVersion>latest</LangVersion>
-    <BuildForCSharp8 Condition="'$(BuildForCSharp8)' == ''">true</BuildForCSharp8>
+    <!-- While in beta, we need to set 8.0 manually (rather than latest). -->
+    <LangVersion>8.0</LangVersion>
   </PropertyGroup>
 
   <!-- Hack needed to make code coverage work. See https://github.com/Microsoft/vstest/issues/1748. -->
@@ -25,11 +25,6 @@
     <DebugType>full</DebugType>
   </PropertyGroup>
 
-  <!-- While in beta, we need to set 8.0 manually (rather than latest). -->
-  <PropertyGroup Condition="'$(BuildForCSharp8)' == 'true'">
-    <LangVersion>8.0</LangVersion>
-  </PropertyGroup>
-
   <ItemGroup>
     <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
     <PackageReference Include="Nerdbank.GitVersioning" Version="2.3.38" PrivateAssets="all" />

+ 3 - 2
Ix.NET/Source/Directory.build.targets

@@ -11,8 +11,9 @@
     <DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_TASK_FROMEXCEPTION</DefineConstants>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(BuildForCSharp8)' == 'true'">
-    <DefineConstants>$(DefineConstants);CSHARP8</DefineConstants>
+  <PropertyGroup>
+    <!-- TODO: Enable USE_ASYNC_ITERATOR -->
+    <DefineConstants>$(DefineConstants);USE_AWAIT_FOREACH;USE_AWAIT_USING</DefineConstants>
   </PropertyGroup>
 
   <PropertyGroup>

+ 8 - 8
Ix.NET/Source/Playground/Program.cs

@@ -78,8 +78,8 @@ namespace Playground
             var xs = new List<int> { 1, 2, 3 };
             var ys = xs.ToAsyncEnumerable().Where(x => x % 2 == 0);
 
-#if CSHARP8
-            foreach await (var y in ys)
+#if USE_AWAIT_FOREACH
+            await foreach (var y in ys)
             {
                 Console.WriteLine(y);
             }
@@ -108,8 +108,8 @@ namespace Playground
             var xs = new List<int> { 1, 2, 3 }.AsQueryable();
             var ys = xs.ToAsyncEnumerable().Where(x => x % 2 == 0);
 
-#if CSHARP8
-            foreach await (var y in ys)
+#if USE_AWAIT_FOREACH
+            await foreach (var y in ys)
             {
                 Console.WriteLine(y);
             }
@@ -138,8 +138,8 @@ namespace Playground
             var xs = new List<int> { 1, 2, 3 };
             var ys = xs.ToAsyncEnumerable().Distinct(x => x % 2);
 
-#if CSHARP8
-            foreach await (var y in ys)
+#if USE_AWAIT_FOREACH
+            await foreach (var y in ys)
             {
                 Console.WriteLine(y);
             }
@@ -157,8 +157,8 @@ namespace Playground
             var xs = new List<int> { 1, 2, 3 }.AsQueryable();
             var ys = xs.ToAsyncEnumerable().Distinct(x => x % 2);
 
-#if CSHARP8
-            foreach await (var y in ys)
+#if USE_AWAIT_FOREACH
+            await foreach (var y in ys)
             {
                 Console.WriteLine(y);
             }

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Max.cs

@@ -24,7 +24,7 @@ namespace System.Linq
                     comparer = Comparer<TSource>.Default;
                 }
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Min.cs

@@ -24,7 +24,7 @@ namespace System.Linq
                     comparer = Comparer<TSource>.Default;
                 }
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/MinBy.cs

@@ -110,7 +110,7 @@ namespace System.Linq
         {
             var result = new List<TSource>();
 
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 if (!await e.MoveNextAsync())
@@ -181,7 +181,7 @@ namespace System.Linq
         {
             var result = new List<TSource>();
 
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 if (!await e.MoveNextAsync())
@@ -253,7 +253,7 @@ namespace System.Linq
         {
             var result = new List<TSource>();
 
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 if (!await e.MoveNextAsync())

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerableHelpers.cs

@@ -44,7 +44,7 @@ namespace System.Collections.Generic
             }
             else
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var en = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
                 {
                     if (await en.MoveNextAsync())
@@ -162,7 +162,7 @@ namespace System.Collections.Generic
         {
             var set = new Set<T>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (T item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 set.Add(item);

+ 9 - 9
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs

@@ -21,7 +21,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, TSource, TSource> _accumulator, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -76,7 +76,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, TSource, ValueTask<TSource>> _accumulator, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -132,7 +132,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, TSource, CancellationToken, ValueTask<TSource>> _accumulator, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -190,7 +190,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = _accumulator(acc, item);
@@ -228,7 +228,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item).ConfigureAwait(false);
@@ -267,7 +267,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item, _cancellationToken).ConfigureAwait(false);
@@ -308,7 +308,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = _accumulator(acc, item);
@@ -348,7 +348,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item).ConfigureAwait(false);
@@ -389,7 +389,7 @@ namespace System.Linq
             {
                 var acc = _seed;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     acc = await _accumulator(acc, item, _cancellationToken).ConfigureAwait(false);

+ 3 - 5
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs

@@ -21,7 +21,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!_predicate(item))
@@ -61,8 +61,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
-
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await _predicate(item).ConfigureAwait(false))
@@ -103,8 +102,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
-
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await _predicate(item, _cancellationToken).ConfigureAwait(false))

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs

@@ -19,7 +19,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     return await e.MoveNextAsync();
@@ -50,7 +50,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
@@ -90,7 +90,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
@@ -131,7 +131,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs

@@ -206,7 +206,7 @@ namespace System.Linq
                 }
                 else
                 {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         array[index] = item;
@@ -251,7 +251,7 @@ namespace System.Linq
                     list.Add(_item);
                 }
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);
@@ -428,7 +428,7 @@ namespace System.Linq
                 }
                 else
                 {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         array[index] = item;
@@ -471,7 +471,7 @@ namespace System.Linq
                     list.Add(n.Item);
                 }
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);

+ 40 - 40
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs

@@ -19,7 +19,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<int> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -82,7 +82,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, int> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -145,7 +145,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<int>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -209,7 +209,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<int>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -271,7 +271,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<long> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -334,7 +334,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, long> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -397,7 +397,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<long>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -461,7 +461,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<long>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -523,7 +523,7 @@ namespace System.Linq
 
             static async Task<float> Core(IAsyncEnumerable<float> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -586,7 +586,7 @@ namespace System.Linq
 
             static async Task<float> Core(IAsyncEnumerable<TSource> _source, Func<TSource, float> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -649,7 +649,7 @@ namespace System.Linq
 
             static async Task<float> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<float>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -713,7 +713,7 @@ namespace System.Linq
 
             static async Task<float> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<float>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -775,7 +775,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<double> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -838,7 +838,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, double> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -901,7 +901,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<double>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -965,7 +965,7 @@ namespace System.Linq
 
             static async Task<double> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<double>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1027,7 +1027,7 @@ namespace System.Linq
 
             static async Task<decimal> Core(IAsyncEnumerable<decimal> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1090,7 +1090,7 @@ namespace System.Linq
 
             static async Task<decimal> Core(IAsyncEnumerable<TSource> _source, Func<TSource, decimal> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1153,7 +1153,7 @@ namespace System.Linq
 
             static async Task<decimal> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<decimal>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1217,7 +1217,7 @@ namespace System.Linq
 
             static async Task<decimal> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<decimal>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1279,7 +1279,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<int?> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1356,7 +1356,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, int?> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1433,7 +1433,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<int?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1511,7 +1511,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<int?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1587,7 +1587,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<long?> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1664,7 +1664,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, long?> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1741,7 +1741,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<long?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1819,7 +1819,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<long?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1895,7 +1895,7 @@ namespace System.Linq
 
             static async Task<float?> Core(IAsyncEnumerable<float?> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -1972,7 +1972,7 @@ namespace System.Linq
 
             static async Task<float?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, float?> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2049,7 +2049,7 @@ namespace System.Linq
 
             static async Task<float?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<float?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2127,7 +2127,7 @@ namespace System.Linq
 
             static async Task<float?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<float?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2203,7 +2203,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<double?> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2280,7 +2280,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, double?> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2357,7 +2357,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<double?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2435,7 +2435,7 @@ namespace System.Linq
 
             static async Task<double?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<double?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2511,7 +2511,7 @@ namespace System.Linq
 
             static async Task<decimal?> Core(IAsyncEnumerable<decimal?> _source, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2588,7 +2588,7 @@ namespace System.Linq
 
             static async Task<decimal?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, decimal?> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2665,7 +2665,7 @@ namespace System.Linq
 
             static async Task<decimal?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<decimal?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -2743,7 +2743,7 @@ namespace System.Linq
 
             static async Task<decimal?> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<decimal?>> _selector, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())

+ 8 - 8
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt

@@ -58,7 +58,7 @@ foreach (var o in os)
 if (isNullable)
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -126,7 +126,7 @@ if (isNullable)
 else
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -196,7 +196,7 @@ else
 if (isNullable)
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -264,7 +264,7 @@ if (isNullable)
 else
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -334,7 +334,7 @@ else
 if (isNullable)
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -402,7 +402,7 @@ if (isNullable)
 else
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -473,7 +473,7 @@ else
 if (isNullable)
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -541,7 +541,7 @@ if (isNullable)
 else
 {
 #>
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs

@@ -84,7 +84,7 @@ namespace System.Linq
                         break;
                     }
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         list.Add(item);

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs

@@ -28,7 +28,7 @@ namespace System.Linq
 
                 static async Task<bool> Core(IAsyncEnumerable<TSource> _source, TSource _value, CancellationToken _cancellationToken)
                 {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         if (EqualityComparer<TSource>.Default.Equals(item, _value))
@@ -64,7 +64,7 @@ namespace System.Linq
 
                 static async Task<bool> Core(IAsyncEnumerable<TSource> _source, TSource _value, IEqualityComparer<TSource> _comparer, CancellationToken _cancellationToken)
                 {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         if (_comparer.Equals(item, _value))

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs

@@ -32,7 +32,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -76,7 +76,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
@@ -126,7 +126,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
@@ -177,7 +177,7 @@ namespace System.Linq
             {
                 var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs

@@ -37,7 +37,7 @@ namespace System.Linq
 
                     if (_index >= 0)
                     {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                         await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                         {
                             if (_index == 0)

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs

@@ -40,7 +40,7 @@ namespace System.Linq
                     }
                     else
                     {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                         await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                         {
                             if (_index == 0)

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             if (second == null)
                 throw Error.ArgumentNull(nameof(second));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -46,7 +46,7 @@ namespace System.Linq
 #endif
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class ExceptAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly IEqualityComparer<TSource> _comparer;

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs

@@ -97,7 +97,7 @@ namespace System.Linq
 
                 static async ValueTask<Maybe<TSource>> Core(IAsyncEnumerable<TSource> _source, CancellationToken _cancellationToken)
                 {
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (await e.MoveNextAsync())
@@ -130,7 +130,7 @@ namespace System.Linq
 
         private static async Task<Maybe<TSource>> TryGetFirst<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, bool> predicate, CancellationToken cancellationToken)
         {
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 while (await e.MoveNextAsync())
@@ -169,7 +169,7 @@ namespace System.Linq
 
         private static async Task<Maybe<TSource>> TryGetFirst<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<bool>> predicate, CancellationToken cancellationToken)
         {
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 while (await e.MoveNextAsync())
@@ -209,7 +209,7 @@ namespace System.Linq
 #if !NO_DEEP_CANCELLATION
         private static async Task<Maybe<TSource>> TryGetFirst<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate, CancellationToken cancellationToken)
         {
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 while (await e.MoveNextAsync())

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs

@@ -28,7 +28,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Action<TSource> _action, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     _action(item);
@@ -64,7 +64,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     _action(item, checked(index++));
@@ -98,7 +98,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Func<TSource, Task> _action, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item).ConfigureAwait(false);
@@ -127,7 +127,7 @@ namespace System.Linq
 
             static async Task Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, Task> _action, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, _cancellationToken).ConfigureAwait(false);
@@ -163,7 +163,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, checked(index++)).ConfigureAwait(false);
@@ -199,7 +199,7 @@ namespace System.Linq
             {
                 var index = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     await _action(item, checked(index++), _cancellationToken).ConfigureAwait(false);

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs

@@ -26,7 +26,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -68,7 +68,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -111,7 +111,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -138,7 +138,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class GroupJoinAsyncEnumerable<TOuter, TInner, TKey, TResult> : IAsyncEnumerable<TResult>
         {
             private readonly IEqualityComparer<TKey> _comparer;

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             if (second == null)
                 throw Error.ArgumentNull(nameof(second));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -46,7 +46,7 @@ namespace System.Linq
 #endif
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class IntersectAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly IEqualityComparer<TSource> _comparer;

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs

@@ -27,7 +27,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -85,7 +85,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -144,7 +144,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -187,7 +187,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class JoinAsyncIterator<TOuter, TInner, TKey, TResult> : AsyncIterator<TResult>
         {
             private readonly IAsyncEnumerable<TOuter> _outer;

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs

@@ -101,7 +101,7 @@ namespace System.Linq
                     var last = default(TSource);
                     var hasLast = false;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         hasLast = true;
@@ -136,7 +136,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (predicate(item))
@@ -175,7 +175,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (await predicate(item).ConfigureAwait(false))
@@ -215,7 +215,7 @@ namespace System.Linq
             var last = default(TSource);
             var hasLast = false;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 if (await predicate(item, cancellationToken).ConfigureAwait(false))

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -65,7 +65,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (_predicate(item))
@@ -115,7 +115,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item).ConfigureAwait(false))
@@ -166,7 +166,7 @@ namespace System.Linq
             {
                 var count = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     if (await _predicate(item, _cancellationToken).ConfigureAwait(false))

+ 9 - 9
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Lookup.cs

@@ -91,7 +91,7 @@ namespace System.Linq.Internal
 
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
@@ -132,7 +132,7 @@ namespace System.Linq.Internal
 
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
@@ -164,7 +164,7 @@ namespace System.Linq.Internal
         {
             var lookup = new Lookup<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = keySelector(item);
@@ -419,7 +419,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
@@ -462,7 +462,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);
@@ -504,7 +504,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
@@ -540,7 +540,7 @@ namespace System.Linq.Internal
 
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);
@@ -573,7 +573,7 @@ namespace System.Linq.Internal
         {
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item).ConfigureAwait(false);
@@ -612,7 +612,7 @@ namespace System.Linq.Internal
         {
             var lookup = new LookupWithTask<TKey, TElement>(comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (TElement item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 var key = await keySelector(item, cancellationToken).ConfigureAwait(false);

+ 8 - 8
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs

@@ -25,7 +25,7 @@ namespace System.Linq
 
                     var value = default(TSource);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -93,7 +93,7 @@ namespace System.Linq
 
                     var value = default(TSource);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -160,7 +160,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -228,7 +228,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -295,7 +295,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -363,7 +363,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -432,7 +432,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -500,7 +500,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())

+ 8 - 8
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs

@@ -25,7 +25,7 @@ namespace System.Linq
 
                     var value = default(TSource);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -93,7 +93,7 @@ namespace System.Linq
 
                     var value = default(TSource);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -161,7 +161,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -229,7 +229,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -297,7 +297,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -365,7 +365,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())
@@ -434,7 +434,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         do
@@ -502,7 +502,7 @@ namespace System.Linq
 
                     var value = default(TResult);
 
-#if CSHARP8
+#if USE_AWAIT_USING
                     await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                     {
                         if (!await e.MoveNextAsync())

+ 80 - 80
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -84,7 +84,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -147,7 +147,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -211,7 +211,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -273,7 +273,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -414,7 +414,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -555,7 +555,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -697,7 +697,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -837,7 +837,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -900,7 +900,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -963,7 +963,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1027,7 +1027,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1089,7 +1089,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -1230,7 +1230,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -1371,7 +1371,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -1513,7 +1513,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -1653,7 +1653,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1746,7 +1746,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1839,7 +1839,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -1933,7 +1933,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -2025,7 +2025,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -2158,7 +2158,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -2291,7 +2291,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -2425,7 +2425,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -2557,7 +2557,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -2650,7 +2650,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -2743,7 +2743,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -2837,7 +2837,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -2929,7 +2929,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3062,7 +3062,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3195,7 +3195,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3329,7 +3329,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3461,7 +3461,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -3524,7 +3524,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -3587,7 +3587,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -3651,7 +3651,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -3713,7 +3713,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3802,7 +3802,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3891,7 +3891,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -3981,7 +3981,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -4069,7 +4069,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4132,7 +4132,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4195,7 +4195,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4259,7 +4259,7 @@ namespace System.Linq
             {
                 int value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4321,7 +4321,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -4414,7 +4414,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -4507,7 +4507,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -4601,7 +4601,7 @@ namespace System.Linq
             {
                 int? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -4693,7 +4693,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4756,7 +4756,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4819,7 +4819,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4883,7 +4883,7 @@ namespace System.Linq
             {
                 long value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -4945,7 +4945,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5038,7 +5038,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5131,7 +5131,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5225,7 +5225,7 @@ namespace System.Linq
             {
                 long? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5317,7 +5317,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -5412,7 +5412,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -5507,7 +5507,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -5603,7 +5603,7 @@ namespace System.Linq
             {
                 float value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -5697,7 +5697,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5822,7 +5822,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -5947,7 +5947,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -6073,7 +6073,7 @@ namespace System.Linq
             {
                 float? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -6197,7 +6197,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -6292,7 +6292,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -6387,7 +6387,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -6483,7 +6483,7 @@ namespace System.Linq
             {
                 double value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -6577,7 +6577,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -6702,7 +6702,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -6827,7 +6827,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -6953,7 +6953,7 @@ namespace System.Linq
             {
                 double? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -7077,7 +7077,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -7140,7 +7140,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -7203,7 +7203,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -7267,7 +7267,7 @@ namespace System.Linq
             {
                 decimal value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -7329,7 +7329,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -7418,7 +7418,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -7507,7 +7507,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -7597,7 +7597,7 @@ namespace System.Linq
             {
                 decimal? value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.tt

@@ -43,7 +43,7 @@ foreach (var m in new[] { "Max", "Min" })
 #>
                 <#=t#> value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -187,7 +187,7 @@ foreach (var m in new[] { "Max", "Min" })
 #>
                 <#=t#> value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)
@@ -545,7 +545,7 @@ foreach (var overload in new[] {
 #>
                 <#=t#> value;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -689,7 +689,7 @@ foreach (var overload in new[] {
 #>
                 <#=t#> value = null;
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     // Start off knowing that we've a non-null value (or exit here, knowing we don't)

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs

@@ -264,7 +264,7 @@ namespace System.Linq
 
         public async ValueTask<Maybe<TElement>> TryGetFirstAsync(CancellationToken cancellationToken)
         {
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = _source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 if (!await e.MoveNextAsync())
@@ -327,7 +327,7 @@ namespace System.Linq
 
         public async ValueTask<Maybe<TElement>> TryGetLastAsync(CancellationToken cancellationToken)
         {
-#if CSHARP8
+#if USE_AWAIT_USING
             await using (var e = _source.GetAsyncEnumerator(cancellationToken).ConfigureAwait(false))
             {
                 if (!await e.MoveNextAsync())

+ 5 - 5
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs

@@ -36,7 +36,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -103,7 +103,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -133,7 +133,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -217,7 +217,7 @@ namespace System.Linq
             }
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class SelectEnumerableWithIndexAsyncIterator<TSource, TResult> : AsyncIterator<TResult>
         {
             private readonly Func<TSource, int, TResult> _selector;
@@ -523,7 +523,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class SelectEnumerableWithIndexAsyncIteratorWithTask<TSource, TResult> : AsyncIterator<TResult>
         {
             private readonly Func<TSource, int, ValueTask<TResult>> _selector;

+ 16 - 16
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs

@@ -50,7 +50,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -84,7 +84,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -119,7 +119,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -156,7 +156,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -185,7 +185,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -215,7 +215,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -245,7 +245,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -281,7 +281,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -318,7 +318,7 @@ namespace System.Linq
             if (resultSelector == null)
                 throw Error.ArgumentNull(nameof(resultSelector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -402,7 +402,7 @@ namespace System.Linq
                 {
                     var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         checked
@@ -446,7 +446,7 @@ namespace System.Linq
             {
                 var list = new List<TResult>();
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     var items = _selector(element);
@@ -578,7 +578,7 @@ namespace System.Linq
                 {
                     var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         var items = await _selector(element).ConfigureAwait(false);
@@ -626,7 +626,7 @@ namespace System.Linq
             {
                 var list = new List<TResult>();
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     var items = await _selector(element).ConfigureAwait(false);
@@ -759,7 +759,7 @@ namespace System.Linq
                 {
                     var count = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (var element in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                     {
                         var items = await _selector(element, _cancellationToken).ConfigureAwait(false);
@@ -807,7 +807,7 @@ namespace System.Linq
             {
                 var list = new List<TResult>();
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (var element in _source.WithCancellation(cancellationToken).ConfigureAwait(false))
                 {
                     var items = await _selector(element, cancellationToken).ConfigureAwait(false);
@@ -884,7 +884,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class SelectManyAsyncIterator<TSource, TCollection, TResult> : AsyncIterator<TResult>
         {
             private const int State_Source = 1;

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs

@@ -52,7 +52,7 @@ namespace System.Linq
 
             static async Task<bool> Core(IAsyncEnumerable<TSource> _first, IAsyncEnumerable<TSource> _second, IEqualityComparer<TSource> _comparer, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e1 = _first.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     await using (var e2 = _second.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs

@@ -30,7 +30,7 @@ namespace System.Linq
                     throw Error.MoreThanOneElement();
                 }
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -84,7 +84,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -149,7 +149,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -215,7 +215,7 @@ namespace System.Linq
 
             static async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs

@@ -30,7 +30,7 @@ namespace System.Linq
                     throw Error.MoreThanOneElement();
                 }
 
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     if (!await e.MoveNextAsync())
@@ -83,7 +83,7 @@ namespace System.Linq
 
             async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, bool> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -148,7 +148,7 @@ namespace System.Linq
 
             async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())
@@ -214,7 +214,7 @@ namespace System.Linq
 
             async Task<TSource> Core(IAsyncEnumerable<TSource> _source, Func<TSource, CancellationToken, ValueTask<bool>> _predicate, CancellationToken _cancellationToken)
             {
-#if CSHARP8
+#if USE_AWAIT_USING
                 await using (var e = _source.GetAsyncEnumerator(_cancellationToken).ConfigureAwait(false))
                 {
                     while (await e.MoveNextAsync())

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs

@@ -28,7 +28,7 @@ namespace System.Linq
                 count = 0;
             }
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -61,7 +61,7 @@ namespace System.Linq
 #endif
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class SkipLastAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly int _count;

+ 7 - 7
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs

@@ -18,7 +18,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -55,7 +55,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -99,7 +99,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -137,7 +137,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -175,7 +175,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -220,7 +220,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -258,7 +258,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class SkipWhileAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly Func<TSource, bool> _predicate;

+ 40 - 40
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (int value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -65,7 +65,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -113,7 +113,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -162,7 +162,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -209,7 +209,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (long value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -253,7 +253,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -301,7 +301,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -350,7 +350,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -397,7 +397,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (float value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value;
@@ -435,7 +435,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -477,7 +477,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -520,7 +520,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -561,7 +561,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (double value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value;
@@ -599,7 +599,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -641,7 +641,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -684,7 +684,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -725,7 +725,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (decimal value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value;
@@ -763,7 +763,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -805,7 +805,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -848,7 +848,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -889,7 +889,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (int? value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -933,7 +933,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -981,7 +981,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -1030,7 +1030,7 @@ namespace System.Linq
             {
                 var sum = 0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -1077,7 +1077,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (long? value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     checked
@@ -1121,7 +1121,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -1169,7 +1169,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -1218,7 +1218,7 @@ namespace System.Linq
             {
                 var sum = 0L;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -1265,7 +1265,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (float? value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value.GetValueOrDefault();
@@ -1303,7 +1303,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -1345,7 +1345,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -1388,7 +1388,7 @@ namespace System.Linq
             {
                 var sum = 0.0f;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -1429,7 +1429,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (double? value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value.GetValueOrDefault();
@@ -1467,7 +1467,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -1509,7 +1509,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -1552,7 +1552,7 @@ namespace System.Linq
             {
                 var sum = 0.0;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);
@@ -1593,7 +1593,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (decimal? value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     sum += value.GetValueOrDefault();
@@ -1631,7 +1631,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -1673,7 +1673,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -1716,7 +1716,7 @@ namespace System.Linq
             {
                 var sum = 0m;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt

@@ -46,7 +46,7 @@ foreach (var o in os)
             {
                 var sum = <#=o.zero#>;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (<#=o.type#> value in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
 <#
@@ -116,7 +116,7 @@ else
             {
                 var sum = <#=o.zero#>;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = _selector(item);
@@ -190,7 +190,7 @@ else
             {
                 var sum = <#=o.zero#>;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item).ConfigureAwait(false);
@@ -265,7 +265,7 @@ else
             {
                 var sum = <#=o.zero#>;
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var value = await _selector(item, _cancellationToken).ConfigureAwait(false);

+ 2 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs

@@ -21,7 +21,7 @@ namespace System.Linq
                 return Empty<TSource>();
             }
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -69,7 +69,7 @@ namespace System.Linq
 #endif
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class TakeLastAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly int _count;

+ 7 - 7
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs

@@ -18,7 +18,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -45,7 +45,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -79,7 +79,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -107,7 +107,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -135,7 +135,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -170,7 +170,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -198,7 +198,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class TakeWhileAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly Func<TSource, bool> _predicate;

+ 6 - 6
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs

@@ -26,7 +26,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = _keySelector(item);
@@ -73,7 +73,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item).ConfigureAwait(false);
@@ -121,7 +121,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TSource>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item, _cancellationToken).ConfigureAwait(false);
@@ -171,7 +171,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = _keySelector(item);
@@ -222,7 +222,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item).ConfigureAwait(false);
@@ -274,7 +274,7 @@ namespace System.Linq
             {
                 var d = new Dictionary<TKey, TElement>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     var key = await _keySelector(item, _cancellationToken).ConfigureAwait(false);

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs

@@ -24,7 +24,7 @@ namespace System.Linq
             {
                 var set = new HashSet<TSource>(_comparer);
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     set.Add(item);

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs

@@ -24,7 +24,7 @@ namespace System.Linq
             {
                 var list = new List<TSource>();
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                 await foreach (TSource item in _source.WithCancellation(_cancellationToken).ConfigureAwait(false))
                 {
                     list.Add(item);

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs

@@ -162,7 +162,7 @@ namespace System.Linq
                         return set;
                     }
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
                     await foreach (TSource item in enumerable.WithCancellation(cancellationToken).ConfigureAwait(false))
                     {
                         set.Add(item);

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Utilities.cs

@@ -38,7 +38,7 @@ namespace System.Linq
                 }
             }
 
-#if CSHARP8
+#if USE_AWAIT_FOREACH
             await foreach (var item in collection.WithCancellation(cancellationToken).ConfigureAwait(false))
             {
                 list.Add(item);

+ 5 - 5
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs

@@ -34,7 +34,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -100,7 +100,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -133,7 +133,7 @@ namespace System.Linq
             if (predicate == null)
                 throw Error.ArgumentNull(nameof(predicate));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
@@ -228,7 +228,7 @@ namespace System.Linq
             }
         }
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class WhereEnumerableWithIndexAsyncIterator<TSource> : AsyncIterator<TSource>
         {
             private readonly Func<TSource, int, bool> _predicate;
@@ -428,7 +428,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class WhereEnumerableWithIndexAsyncIteratorWithTask<TSource> : AsyncIterator<TSource>
         {
             private readonly Func<TSource, int, ValueTask<bool>> _predicate;

+ 4 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs

@@ -20,7 +20,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -50,7 +50,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -81,7 +81,7 @@ namespace System.Linq
             if (selector == null)
                 throw Error.ArgumentNull(nameof(selector));
 
-#if CSHARP8 && USE_ASYNC_ITERATOR
+#if USE_ASYNC_ITERATOR
             return Create(Core);
 
             async IAsyncEnumerator<TResult> Core(CancellationToken cancellationToken)
@@ -103,7 +103,7 @@ namespace System.Linq
         }
 #endif
 
-#if !(CSHARP8 && USE_ASYNC_ITERATOR)
+#if !USE_ASYNC_ITERATOR
         private sealed class ZipAsyncIterator<TFirst, TSecond, TResult> : AsyncIterator<TResult>
         {
             private readonly IAsyncEnumerable<TFirst> _first;