فهرست منبع

Merge pull request #367 from Reactive-Extensions/WeGotTplNow

Removing conditional compilation for TPL
Bart J.F. De Smet 8 سال پیش
والد
کامیت
2fcaeb17c4
38فایلهای تغییر یافته به همراه31 افزوده شده و 374 حذف شده
  1. 0 7
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs
  2. 5 23
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs
  3. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs
  4. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.cs
  5. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs
  6. 0 2
      Rx.NET/Source/src/System.Reactive/Disposables/CancellationDisposable.cs
  7. 0 2
      Rx.NET/Source/src/System.Reactive/Internal/CurrentPlatformEnlightenmentProvider.cs
  8. 1 27
      Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.cs
  9. 0 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs
  10. 0 11
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs
  11. 0 5
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Imperative.cs
  12. 0 15
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs
  13. 0 7
      Rx.NET/Source/src/System.Reactive/Linq/Observable.StandardSequenceOperators.cs
  14. 1 11
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Merge.cs
  15. 6 23
      Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs
  16. 0 74
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs
  17. 1 3
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs
  18. 0 11
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Async.cs
  19. 2 13
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs
  20. 2 7
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Imperative.cs
  21. 0 9
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Multiple.cs
  22. 0 8
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs
  23. 0 2
      Rx.NET/Source/src/System.Reactive/Observable.Extensions.cs
  24. 0 2
      Rx.NET/Source/src/System.Reactive/Threading/Tasks/TaskObservableExtensions.cs
  25. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Stress/Linq/ReplaySubject.cs
  26. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/TestTaskScheduler.cs
  27. 0 8
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
  28. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs
  29. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs
  30. 1 14
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableAsyncTest.cs
  31. 1 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs
  32. 2 17
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableCreationTest.cs
  33. 0 5
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableExtensionsTest.cs
  34. 1 6
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableImperativeTest.cs
  35. 4 22
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableMultipleTest.cs
  36. 2 11
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableStandardQueryOperatorTest.cs
  37. 1 6
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/ReplaySubjectTest.cs
  38. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/TaskObservableExtensionsTest.cs

+ 0 - 7
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs

@@ -8,12 +8,9 @@ using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Reactive;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks; // needed for doc comments
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 /*
  * Note: these methods just call methods in Observable.StandardSequenceOperators.cs
@@ -108,7 +105,6 @@ namespace System.Reactive.Observable.Aliases
             return source.SelectMany<TSource, TResult>(selector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -172,7 +168,6 @@ namespace System.Reactive.Observable.Aliases
         {
             return source.SelectMany<TSource, TResult>(selector);
         }
-#endif
 
         /// <summary>
         /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
@@ -208,7 +203,6 @@ namespace System.Reactive.Observable.Aliases
             return source.SelectMany<TSource, TCollection, TResult>(collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -280,7 +274,6 @@ namespace System.Reactive.Observable.Aliases
         {
             return source.SelectMany<TSource, TTaskResult, TResult>(taskSelector, resultSelector);
         }
-#endif
 
         /// <summary>
         /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.

+ 5 - 23
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs

@@ -8,19 +8,17 @@
 #if !NO_EXPRESSIONS
 
 using System;
-using System.Reactive.Concurrency;
 using System.Collections.Generic;
-using System.Reactive.Joins;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Linq.Expressions;
-using System.Reflection;
-using System.Threading;
 using System.Reactive;
+using System.Reactive.Concurrency;
+using System.Reactive.Joins;
 using System.Reactive.Subjects;
-using System.Diagnostics.CodeAnalysis;
-#if !NO_TPL
+using System.Reflection;
+using System.Threading;
 using System.Threading.Tasks;
-#endif
 #if !NO_REMOTING
 using System.Runtime.Remoting.Lifetime;
 #endif
@@ -218,7 +216,6 @@ namespace System.Reactive.Linq
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -235,9 +232,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -254,9 +249,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -273,9 +266,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -292,7 +283,6 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
         /// <summary>
         /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
@@ -328,7 +318,6 @@ namespace System.Reactive.Linq
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -347,9 +336,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -368,9 +355,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -389,9 +374,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -410,7 +393,6 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
         /// <summary>
         /// Projects each element of an observable sequence into a new form. Synonym for the method 'Select'

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs

@@ -117,7 +117,6 @@ namespace System.Reactive.Concurrency
             }
         }
 
-#if !NO_TPL
         private static Lazy<IScheduler> s_taskPool = new Lazy<IScheduler>(() => Initialize("TaskPool"));
 
         /// <summary>
@@ -131,7 +130,6 @@ namespace System.Reactive.Concurrency
                 return s_taskPool.Value;
             }
         }
-#endif
 
         private static IScheduler Initialize(string name)
         {

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
 
@@ -30,4 +29,3 @@ namespace System.Reactive.Concurrency
         }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System.Reactive.Disposables;
 using System.Threading;
 using System.Threading.Tasks;
@@ -205,4 +204,3 @@ namespace System.Reactive.Concurrency
         }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Disposables/CancellationDisposable.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System.Threading;
 
 namespace System.Reactive.Disposables
@@ -60,4 +59,3 @@ namespace System.Reactive.Disposables
         }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Internal/CurrentPlatformEnlightenmentProvider.cs

@@ -52,10 +52,8 @@ namespace System.Reactive.PlatformServices
                     case "ThreadPool":
                         return (T)(object)ThreadPoolScheduler.Default;
 #endif
-#if !NO_TPL
                     case "TaskPool":
                         return (T)(object)TaskPoolScheduler.Default;
-#endif
                     case "NewThread":
                         return (T)(object)NewThreadScheduler.Default;
                 }

+ 1 - 27
Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.cs

@@ -8,14 +8,8 @@ using System.Reactive.Concurrency;
 using System.Reactive.Joins;
 using System.Reactive.Subjects;
 using System.Threading;
-
-#if !NO_REMOTING
-
-#endif
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
+
 
 namespace System.Reactive.Linq
 {
@@ -199,24 +193,19 @@ namespace System.Reactive.Linq
         IObservable<TSource> Start<TSource>(Func<TSource> function);
         IObservable<TSource> Start<TSource>(Func<TSource> function, IScheduler scheduler);
 
-#if !NO_TPL
         IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync);
         IObservable<TSource> StartAsync<TSource>(Func<CancellationToken, Task<TSource>> functionAsync);
         IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync, IScheduler scheduler);
         IObservable<TSource> StartAsync<TSource>(Func<CancellationToken, Task<TSource>> functionAsync, IScheduler scheduler);
-#endif
 
         IObservable<Unit> Start(Action action);
         IObservable<Unit> Start(Action action, IScheduler scheduler);
 
-#if !NO_TPL
         IObservable<Unit> StartAsync(Func<Task> actionAsync);
         IObservable<Unit> StartAsync(Func<CancellationToken, Task> actionAsync);
         IObservable<Unit> StartAsync(Func<Task> actionAsync, IScheduler scheduler);
         IObservable<Unit> StartAsync(Func<CancellationToken, Task> actionAsync, IScheduler scheduler);
-#endif
 
-#if !NO_TPL
         IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync);
         IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync);
         IObservable<Unit> FromAsync(Func<Task> actionAsync);
@@ -225,7 +214,6 @@ namespace System.Reactive.Linq
         IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync, IScheduler scheduler);
         IObservable<Unit> FromAsync(Func<Task> actionAsync, IScheduler scheduler);
         IObservable<Unit> FromAsync(Func<CancellationToken, Task> actionAsync, IScheduler scheduler);
-#endif
 
         Func<IObservable<TResult>> ToAsync<TResult>(Func<TResult> function);
         Func<IObservable<TResult>> ToAsync<TResult>(Func<TResult> function, IScheduler scheduler);
@@ -395,22 +383,17 @@ namespace System.Reactive.Linq
 
         IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, IDisposable> subscribe);
         IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, Action> subscribe);
-
-#if !NO_TPL
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<IDisposable>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<Action>> subscribeAsync);
-#endif
 
         IObservable<TValue> Defer<TValue>(Func<IObservable<TValue>> observableFactory);
 
-#if !NO_TPL
         IObservable<TValue> Defer<TValue>(Func<Task<IObservable<TValue>>> observableFactoryAsync);
         IObservable<TValue> Defer<TValue>(Func<CancellationToken, Task<IObservable<TValue>>> observableFactoryAsync);
-#endif
 
         IObservable<TResult> Empty<TResult>();
         IObservable<TResult> Empty<TResult>(IScheduler scheduler);
@@ -428,10 +411,7 @@ namespace System.Reactive.Linq
         IObservable<TResult> Throw<TResult>(Exception exception);
         IObservable<TResult> Throw<TResult>(Exception exception, IScheduler scheduler);
         IObservable<TSource> Using<TSource, TResource>(Func<TResource> resourceFactory, Func<TResource, IObservable<TSource>> observableFactory) where TResource : IDisposable;
-
-#if !NO_TPL
         IObservable<TSource> Using<TSource, TResource>(Func<CancellationToken, Task<TResource>> resourceFactoryAsync, Func<TResource, CancellationToken, Task<IObservable<TSource>>> observableFactoryAsync) where TResource : IDisposable;
-#endif
 
         #endregion
 
@@ -473,12 +453,10 @@ namespace System.Reactive.Linq
 
         #region * Imperative *
 
-#if !NO_TPL
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext, CancellationToken cancellationToken);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource, int> onNext);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource, int> onNext, CancellationToken cancellationToken);
-#endif
 
         IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource);
         IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler);
@@ -587,11 +565,9 @@ namespace System.Reactive.Linq
 
         IObservable<TResult> Zip<TFirst, TSecond, TResult>(IObservable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector);
 
-#if !NO_TPL
         IObservable<TSource> Concat<TSource>(IObservable<Task<TSource>> sources);
         IObservable<TSource> Merge<TSource>(IObservable<Task<TSource>> sources);
         IObservable<TSource> Switch<TSource>(IObservable<Task<TSource>> sources);
-#endif
 
         #endregion
 
@@ -683,7 +659,6 @@ namespace System.Reactive.Linq
         IObservable<TSource> Where<TSource>(IObservable<TSource> source, Func<TSource, bool> predicate);
         IObservable<TSource> Where<TSource>(IObservable<TSource> source, Func<TSource, int, bool> predicate);
 
-#if !NO_TPL
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector);
@@ -692,7 +667,6 @@ namespace System.Reactive.Linq
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
-#endif
 
         #endregion
 

+ 0 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs

@@ -927,7 +927,6 @@ namespace System.Reactive.Linq
             return s_impl.Start<TResult>(function, scheduler);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// </summary>
@@ -1033,7 +1032,6 @@ namespace System.Reactive.Linq
 
             return s_impl.StartAsync<TResult>(functionAsync, scheduler);
         }
-#endif
 
         #endregion
 
@@ -1082,7 +1080,6 @@ namespace System.Reactive.Linq
             return s_impl.Start(action, scheduler);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// </summary>
@@ -1184,7 +1181,6 @@ namespace System.Reactive.Linq
 
             return s_impl.StartAsync(actionAsync, scheduler);
         }
-#endif
 
         #endregion
 

+ 0 - 11
Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs

@@ -5,10 +5,7 @@
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -60,7 +57,6 @@ namespace System.Reactive.Linq
 
         #region + CreateAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method.
         /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -162,7 +158,6 @@ namespace System.Reactive.Linq
 
             return s_impl.Create<TResult>(subscribeAsync);
         }
-#endif
 
         #endregion
 
@@ -187,7 +182,6 @@ namespace System.Reactive.Linq
 
         #region + DeferAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Returns an observable sequence that starts the specified asynchronous factory function whenever a new observer subscribes.
         /// </summary>
@@ -221,7 +215,6 @@ namespace System.Reactive.Linq
 
             return s_impl.Defer<TResult>(observableFactoryAsync);
         }
-#endif
 
         #endregion
 
@@ -595,8 +588,6 @@ namespace System.Reactive.Linq
 
         #region + UsingAsync +
 
-#if !NO_TPL
-
         /// <summary>
         /// Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. The resource is obtained and used through asynchronous methods.
         /// The CancellationToken passed to the asynchronous methods is tied to the returned disposable subscription, allowing best-effort cancellation at any stage of the resource acquisition or usage.
@@ -619,8 +610,6 @@ namespace System.Reactive.Linq
             return s_impl.Using<TResult, TResource>(resourceFactoryAsync, observableFactoryAsync);
         }
 
-#endif
-
         #endregion
     }
 }

+ 0 - 5
Rx.NET/Source/src/System.Reactive/Linq/Observable.Imperative.cs

@@ -5,10 +5,7 @@
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -16,7 +13,6 @@ namespace System.Reactive.Linq
     {
         #region + ForEachAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Invokes an action for each element in the observable sequence, and returns a Task object that will get signaled when the sequence terminates.
         /// </summary>
@@ -96,7 +92,6 @@ namespace System.Reactive.Linq
 
             return s_impl.ForEachAsync<TSource>(source, onNext, cancellationToken);
         }
-#endif
 
         #endregion
 

+ 0 - 15
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs

@@ -4,11 +4,8 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-#if !NO_TPL
 using System.Threading; // Used in XML doc comments
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -1098,8 +1095,6 @@ namespace System.Reactive.Linq
             return s_impl.Concat<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Concatenates all task results, as long as the previous task terminated successfully.
         /// </summary>
@@ -1116,8 +1111,6 @@ namespace System.Reactive.Linq
             return s_impl.Concat<TSource>(sources);
         }
 
-#endif
-
         #endregion
 
         #region + Merge +
@@ -1137,8 +1130,6 @@ namespace System.Reactive.Linq
             return s_impl.Merge<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Merges results from all source tasks into a single observable sequence.
         /// </summary>
@@ -1155,8 +1146,6 @@ namespace System.Reactive.Linq
             return s_impl.Merge<TSource>(sources);
         }
 
-#endif
-
         /// <summary>
         /// Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences.
         /// </summary>
@@ -1419,8 +1408,6 @@ namespace System.Reactive.Linq
             return s_impl.Switch<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Transforms an observable sequence of tasks into an observable sequence 
         /// producing values only from the most recent observable sequence.
@@ -1439,8 +1426,6 @@ namespace System.Reactive.Linq
             return s_impl.Switch<TSource>(sources);
         }
 
-#endif
-
         #endregion
 
         #region + TakeUntil +

+ 0 - 7
Rx.NET/Source/src/System.Reactive/Linq/Observable.StandardSequenceOperators.cs

@@ -4,12 +4,9 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks; // needed for doc comments
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -813,7 +810,6 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// </summary>
@@ -893,7 +889,6 @@ namespace System.Reactive.Linq
 
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
 
         /// <summary>
         /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
@@ -941,7 +936,6 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -1037,7 +1031,6 @@ namespace System.Reactive.Linq
 
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
 
         /// <summary>
         /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.

+ 1 - 11
Rx.NET/Source/src/System.Reactive/Linq/Observable/Merge.cs

@@ -6,17 +6,15 @@
 using System;
 using System.Collections.Generic;
 using System.Reactive.Disposables;
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq.ObservableImpl
 {
     class Merge<TSource> : Producer<TSource>
     {
         private readonly IObservable<IObservable<TSource>> _sources;
+        private readonly IObservable<Task<TSource>> _sourcesT;
         private readonly int _maxConcurrent;
 
         public Merge(IObservable<IObservable<TSource>> sources)
@@ -30,14 +28,10 @@ namespace System.Reactive.Linq.ObservableImpl
             _maxConcurrent = maxConcurrent;
         }
 
-#if !NO_TPL
-        private readonly IObservable<Task<TSource>> _sourcesT;
-
         public Merge(IObservable<Task<TSource>> sources)
         {
             _sourcesT = sources;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TSource> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -47,14 +41,12 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_sourcesT != null)
             {
                 var sink = new MergeImpl(this, observer, cancel);
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else
             {
                 var sink = new _(this, observer, cancel);
@@ -308,7 +300,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class MergeImpl : Sink<TSource>, IObserver<Task<TSource>>
         {
             private readonly Merge<TSource> _parent;
@@ -397,7 +388,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 }
 #endif

+ 6 - 23
Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs

@@ -5,11 +5,8 @@
 #if !NO_PERF
 using System.Collections.Generic;
 using System.Reactive.Disposables;
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq.ObservableImpl
 {
@@ -22,6 +19,9 @@ namespace System.Reactive.Linq.ObservableImpl
         private readonly Func<TSource, int, IEnumerable<TCollection>> _collectionSelectorEI;
         private readonly Func<TSource, TCollection, TResult> _resultSelector;
         private readonly Func<TSource, int, TCollection, int, TResult> _resultSelectorI;
+        private readonly Func<TSource, CancellationToken, Task<TCollection>> _collectionSelectorT;
+        private readonly Func<TSource, int, CancellationToken, Task<TCollection>> _collectionSelectorTI;
+        private readonly Func<TSource, int, TCollection, TResult> _resultSelectorTI;
 
         public SelectMany(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
@@ -51,11 +51,6 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelectorI = resultSelector;
         }
 
-#if !NO_TPL
-        private readonly Func<TSource, CancellationToken, Task<TCollection>> _collectionSelectorT;
-        private readonly Func<TSource, int, CancellationToken, Task<TCollection>> _collectionSelectorTI;
-        private readonly Func<TSource, int, TCollection, TResult> _resultSelectorTI;
-
         public SelectMany(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
             _source = source;
@@ -69,7 +64,6 @@ namespace System.Reactive.Linq.ObservableImpl
             _collectionSelectorTI = collectionSelector;
             _resultSelectorTI = resultSelector;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -85,7 +79,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_collectionSelectorT != null)
             {
                 var sink = new SelectManyImpl(this, observer, cancel);
@@ -98,7 +91,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else if (_collectionSelectorE != null)
             {
                 var sink = new NoSelectorImpl(this, observer, cancel);
@@ -586,7 +578,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class SelectManyImpl : Sink<TResult>, IObserver<TSource>
         {
             private readonly SelectMany<TSource, TCollection, TResult> _parent;
@@ -857,7 +848,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 
     class SelectMany<TSource, TResult> : Producer<TResult>
@@ -869,6 +859,8 @@ namespace System.Reactive.Linq.ObservableImpl
         private readonly Func<IObservable<TResult>> _selectorOnCompleted;
         private readonly Func<TSource, IEnumerable<TResult>> _selectorE;
         private readonly Func<TSource, int, IEnumerable<TResult>> _selectorEI;
+        private readonly Func<TSource, CancellationToken, Task<TResult>> _selectorT;
+        private readonly Func<TSource, int, CancellationToken, Task<TResult>> _selectorTI;
 
         public SelectMany(IObservable<TSource> source, Func<TSource, IObservable<TResult>> selector)
         {
@@ -910,22 +902,17 @@ namespace System.Reactive.Linq.ObservableImpl
             _selectorEI = selector;
         }
 
-#if !NO_TPL
-        private readonly Func<TSource, CancellationToken, Task<TResult>> _selectorT;
-        private readonly Func<TSource, int, CancellationToken, Task<TResult>> _selectorTI;
-
         public SelectMany(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector)
         {
             _source = source;
             _selectorT = selector;
         }
-        
+
         public SelectMany(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector)
         {
             _source = source;
             _selectorTI = selector;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -941,7 +928,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_selectorT != null)
             {
                 var sink = new SelectManyImpl(this, observer, cancel);
@@ -954,7 +940,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else if (_selectorE != null)
             {
                 var sink = new NoSelectorImpl(this, observer, cancel);
@@ -1510,7 +1495,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class SelectManyImpl : Sink<TResult>, IObserver<TSource>
         {
             private readonly SelectMany<TSource, TResult> _parent;
@@ -1731,7 +1715,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 }
 #endif

+ 0 - 74
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs

@@ -18,9 +18,7 @@ using System.Threading;
 using System.Reactive;
 using System.Reactive.Subjects;
 using System.Diagnostics.CodeAnalysis;
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 #if !NO_REMOTING
 using System.Runtime.Remoting.Lifetime;
 #endif
@@ -2965,7 +2963,6 @@ namespace System.Reactive.Linq
             );
         }
 
-#if !NO_TPL
         /// <summary>
         /// Concatenates all task results, as long as the previous task terminated successfully.
         /// </summary>
@@ -2992,7 +2989,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Determines whether an observable sequence contains a specified element by using the default equality comparer.
@@ -3185,7 +3181,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method.
         /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -3218,9 +3213,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified asynchronous Subscribe method.
         /// </summary>
@@ -3251,9 +3244,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method.
         /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -3286,9 +3277,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified asynchronous Subscribe method.
         /// </summary>
@@ -3319,9 +3308,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method.
         /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -3354,9 +3341,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified asynchronous Subscribe method.
         /// </summary>
@@ -3387,7 +3372,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Returns the elements of the specified sequence or the type parameter's default value in a singleton sequence if the sequence is empty.
@@ -3473,7 +3457,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Returns an observable sequence that starts the specified asynchronous factory function whenever a new observer subscribes.
         /// </summary>
@@ -3504,9 +3487,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Returns an observable sequence that starts the specified cancellable asynchronous factory function whenever a new observer subscribes.
         /// The CancellationToken passed to the asynchronous factory function is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -3539,7 +3520,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
 
         /// <summary>
         /// Time shifts the observable sequence to start propagating notifications at the specified absolute time.
@@ -4769,7 +4749,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started.
         /// </summary>
@@ -4798,9 +4777,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started.
         /// </summary>
@@ -4833,9 +4810,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started.
         /// The CancellationToken passed to the asynchronous action is tied to the observable sequence's subscription that triggered the action's invocation and can be used for best-effort cancellation.
@@ -4866,9 +4841,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started.
         /// The CancellationToken passed to the asynchronous action is tied to the observable sequence's subscription that triggered the action's invocation and can be used for best-effort cancellation.
@@ -4903,9 +4876,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
         /// </summary>
@@ -4935,9 +4906,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
         /// The CancellationToken passed to the asynchronous function is tied to the observable sequence's subscription that triggered the function's invocation and can be used for best-effort cancellation.
@@ -4969,9 +4938,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
         /// </summary>
@@ -5005,9 +4972,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
         /// The CancellationToken passed to the asynchronous function is tied to the observable sequence's subscription that triggered the function's invocation and can be used for best-effort cancellation.
@@ -5043,7 +5008,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Converts an Action-based .NET event to an observable sequence. Each event invocation is surfaced through an OnNext message in the resulting sequence.
@@ -9187,7 +9151,6 @@ namespace System.Reactive.Linq
             );
         }
 
-#if !NO_TPL
         /// <summary>
         /// Merges results from all source tasks into a single observable sequence.
         /// </summary>
@@ -9214,7 +9177,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Merges elements from all of the specified observable sequences into a single observable sequence.
@@ -11891,7 +11853,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// </summary>
@@ -11923,9 +11884,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
         /// </summary>
@@ -11957,9 +11916,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// </summary>
@@ -11991,9 +11948,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
         /// </summary>
@@ -12025,9 +11980,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -12064,9 +12017,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -12103,9 +12054,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -12142,9 +12091,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -12181,7 +12128,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Determines whether two sequences are equal by comparing the elements pairwise.
@@ -12977,7 +12923,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// </summary>
@@ -13016,9 +12961,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// </summary>
@@ -13061,9 +13004,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information.
@@ -13112,9 +13053,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information.
@@ -13167,9 +13106,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// </summary>
@@ -13209,9 +13146,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information.
@@ -13261,9 +13196,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// </summary>
@@ -13307,9 +13240,7 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information.
@@ -13363,7 +13294,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Prepends a sequence of values to an observable sequence.
@@ -14174,7 +14104,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Transforms an observable sequence of tasks into an observable sequence 
         /// producing values only from the most recent observable sequence.
@@ -14203,7 +14132,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Synchronizes the observable sequence such that observer notifications cannot be delivered concurrently.
@@ -16433,7 +16361,6 @@ namespace System.Reactive.Linq
             );
         }
         
-#if !NO_TPL
         /// <summary>
         /// Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. The resource is obtained and used through asynchronous methods.
         /// The CancellationToken passed to the asynchronous methods is tied to the returned disposable subscription, allowing best-effort cancellation at any stage of the resource acquisition or usage.
@@ -16472,7 +16399,6 @@ namespace System.Reactive.Linq
                 )
             );
         }
-#endif
         
         /// <summary>
         /// Filters the elements of an observable sequence based on a predicate.

+ 1 - 3
Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs

@@ -15,11 +15,9 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Threading;
+using System.Threading.Tasks;
 using System.Reactive;
 using System.Reactive.Subjects;
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
 #if !NO_REMOTING
 using System.Runtime.Remoting.Lifetime;
 #endif

+ 0 - 11
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Async.cs

@@ -5,12 +5,9 @@
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -661,7 +658,6 @@ namespace System.Reactive.Linq
             return ToAsync(function, scheduler)();
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync)
         {
             return StartAsyncImpl(functionAsync, null);
@@ -738,7 +734,6 @@ namespace System.Reactive.Linq
                 return StableCompositeDisposable.Create(cancellable, subscription);
             });
         }
-#endif
 
         #endregion
 
@@ -754,7 +749,6 @@ namespace System.Reactive.Linq
             return ToAsync(action, scheduler)();
         }
 
-#if !NO_TPL
         public virtual IObservable<Unit> StartAsync(Func<Task> actionAsync)
         {
             return StartAsyncImpl(actionAsync, null);
@@ -831,7 +825,6 @@ namespace System.Reactive.Linq
                 return StableCompositeDisposable.Create(cancellable, subscription);
             });
         }
-#endif
 
         #endregion
 
@@ -839,8 +832,6 @@ namespace System.Reactive.Linq
 
         #region FromAsync
 
-#if !NO_TPL
-
         #region Func
 
         public virtual IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync)
@@ -889,8 +880,6 @@ namespace System.Reactive.Linq
 
         #endregion
 
-#endif
-
         #endregion
 
         #region ToAsync

+ 2 - 13
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs

@@ -3,15 +3,12 @@
 // See the LICENSE file in the project root for more information. 
 
 using System.Collections.Generic;
+using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
-using System.Threading;
-using System.Linq;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
+using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -41,7 +38,6 @@ namespace System.Reactive.Linq
 
         #region - CreateAsync -
 
-#if !NO_TPL
         public virtual IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync)
         {
             return new AnonymousObservable<TResult>(observer =>
@@ -110,7 +106,6 @@ namespace System.Reactive.Linq
         {
             return Create<TResult>((observer, token) => subscribeAsync(observer));
         }
-#endif
 
         #endregion
 
@@ -142,7 +137,6 @@ namespace System.Reactive.Linq
 
         #region + DeferAsync +
 
-#if !NO_TPL
         public virtual IObservable<TValue> Defer<TValue>(Func<Task<IObservable<TValue>>> observableFactoryAsync)
         {
             return Defer(() => StartAsync(observableFactoryAsync).Merge());
@@ -152,7 +146,6 @@ namespace System.Reactive.Linq
         {
             return Defer(() => StartAsync(observableFactoryAsync).Merge());
         }
-#endif
 
         #endregion
 
@@ -444,8 +437,6 @@ namespace System.Reactive.Linq
 
         #region - UsingAsync -
 
-#if !NO_TPL
-
         public virtual IObservable<TSource> Using<TSource, TResource>(Func<CancellationToken, Task<TResource>> resourceFactoryAsync, Func<TResource, CancellationToken, Task<IObservable<TSource>>> observableFactoryAsync) where TResource : IDisposable
         {
             return Observable.FromAsync<TResource>(resourceFactoryAsync)
@@ -457,8 +448,6 @@ namespace System.Reactive.Linq
                 );
         }
 
-#endif
-
         #endregion
     }
 }

+ 2 - 7
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Imperative.cs

@@ -7,10 +7,7 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -22,7 +19,6 @@ namespace System.Reactive.Linq
     {
         #region ForEachAsync
 
-#if !NO_TPL
         public virtual Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext)
         {
             return ForEachAsync_(source, onNext, CancellationToken.None);
@@ -133,11 +129,10 @@ namespace System.Reactive.Linq
 
             return tcs.Task;
         }
-#endif
 
-#endregion
+        #endregion
 
-                #region + Case +
+        #region + Case +
 
         public virtual IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources)
         {

+ 0 - 9
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Multiple.cs

@@ -9,11 +9,8 @@ using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -713,12 +710,10 @@ namespace System.Reactive.Linq
             return Concat_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Concat<TSource>(IObservable<Task<TSource>> sources)
         {
             return Concat_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
         }
-#endif
 
         private IObservable<TSource> Concat_<TSource>(IObservable<IObservable<TSource>> sources)
         {
@@ -734,7 +729,6 @@ namespace System.Reactive.Linq
             return Merge_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Merge<TSource>(IObservable<Task<TSource>> sources)
         {
 #if !NO_PERF
@@ -743,7 +737,6 @@ namespace System.Reactive.Linq
             return Merge_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
 #endif
         }
-#endif
 
         public virtual IObservable<TSource> Merge<TSource>(IObservable<IObservable<TSource>> sources, int maxConcurrent)
         {
@@ -1064,12 +1057,10 @@ namespace System.Reactive.Linq
             return Switch_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Switch<TSource>(IObservable<Task<TSource>> sources)
         {
             return Switch_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
         }
-#endif
 
         private IObservable<TSource> Switch_<TSource>(IObservable<IObservable<TSource>> sources)
         {

+ 0 - 8
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs

@@ -4,12 +4,8 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -880,7 +876,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TResult>(source, selector);
         }
 
-#if !NO_TPL
         public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector)
         {
 #if !NO_PERF
@@ -916,7 +911,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TResult>(source, (x, i) => FromAsync(ct => selector(x, i, ct)));
 #endif
         }
-#endif
 
         public virtual IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
@@ -928,7 +922,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
         {
 #if !NO_PERF
@@ -964,7 +957,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TTaskResult, TResult>(source, (x, i) => FromAsync(ct => taskSelector(x, i, ct)), (x, i, t, _) => resultSelector(x, i, t));
 #endif
         }
-#endif
 
         private static IObservable<TResult> SelectMany_<TSource, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TResult>> selector)
         {

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Observable.Extensions.cs

@@ -135,7 +135,6 @@ namespace System
 
         #region Subscribe overloads with CancellationToken
 
-#if !NO_TPL
         /// <summary>
         /// Subscribes an observer to an observable sequence, using a CancellationToken to support unsubscription.
         /// </summary>
@@ -287,7 +286,6 @@ namespace System
                 source.Subscribe(observer);
             }
         }
-#endif
 
         #endregion
 

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Threading/Tasks/TaskObservableExtensions.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System.Reactive.Disposables;
 using System.Threading.Tasks;
 using System.Threading;
@@ -390,4 +389,3 @@ namespace System.Reactive.Threading.Tasks
         }
     }
 }
-#endif

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Stress/Linq/ReplaySubject.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if STRESS && !NO_TPL
+#if STRESS
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/TestTaskScheduler.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System.Collections.Generic;
 using System.Threading.Tasks;
 
@@ -26,4 +25,3 @@ namespace ReactiveTests
         }
     }
 }
-#endif

+ 0 - 8
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs

@@ -66,11 +66,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(DateTimeOffset.MaxValue, default(Action)));
-#if !NO_TPL
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(DateTimeOffset.MaxValue, default(Action)));
-#endif
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(DateTimeOffset.MaxValue, default(Action)));
@@ -196,14 +194,12 @@ namespace ReactiveTests.Tests
             }
 #endif
 
-#if !NO_TPL
             // TaskPool
             {
                 var e = new ManualResetEvent(false);
                 Scheduler.TaskPool.Schedule(() => e.Set());
                 e.WaitOne();
             }
-#endif
         }
 
         #endregion
@@ -243,7 +239,6 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Scheduler.StartStopwatch(null));
         }
 
-#if !NO_TPL
         [Fact]
         public void Scheduler_LongRunning1()
         {
@@ -285,7 +280,6 @@ namespace ReactiveTests.Tests
 
             e.WaitOne();
         }
-#endif
 #endif
 
         #endregion
@@ -446,7 +440,6 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Scheduler.DisableOptimizations(Scheduler.Default).Schedule(42, DateTimeOffset.Now, default(Func<IScheduler, int, IDisposable>)));
         }
 
-#if !NO_TPL
         [Fact]
         public void DisableOptimizations1()
         {
@@ -578,7 +571,6 @@ namespace ReactiveTests.Tests
             });
             e2.WaitOne();
         }
-#endif
 #endif
 
         [Fact]

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System;
 using System.Reactive.Concurrency;
 using System.Threading;
@@ -177,4 +176,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs

@@ -278,7 +278,6 @@ namespace ReactiveTests.Tests
             Assert.True(string.IsNullOrEmpty(r.Value));
         }
 
-#if !NO_TPL
         [Fact]
         public void Cant_Locate_Scheduler()
         {
@@ -308,7 +307,6 @@ namespace ReactiveTests.Tests
 
             Assert.True(e.Value);
         }
-#endif
 
 #if !NO_PERF
         [Fact]

+ 1 - 14
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableAsyncTest.cs

@@ -8,19 +8,15 @@ using System.Reactive;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
 
     public partial class ObservableAsyncTest : ReactiveTest
     {
-#if !NO_TPL
         private Task<int> doneTask;
 
         public ObservableAsyncTest()
@@ -30,7 +26,6 @@ namespace ReactiveTests.Tests
             doneTask = tcs.Task;
         }
 
-#endif
         #region FromAsyncPattern
 
         [Fact]
@@ -1291,8 +1286,6 @@ namespace ReactiveTests.Tests
 
         #region StartAsync
 
-#if !NO_TPL
-
         #region Func
 
         [Fact]
@@ -1684,14 +1677,10 @@ namespace ReactiveTests.Tests
 
         #endregion
 
-#endif
-
         #endregion
 
         #region FromAsync
 
-#if !NO_TPL
-
         #region Func
 
         [Fact]
@@ -2062,8 +2051,6 @@ namespace ReactiveTests.Tests
 
         #endregion
 
-#endif
-
         #endregion
 
         #region ToAsync

+ 1 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs

@@ -10,14 +10,11 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
 

+ 2 - 17
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableCreationTest.cs

@@ -12,15 +12,12 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
-using System.Runtime.CompilerServices;
-
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
 
 namespace ReactiveTests.Tests
 {
@@ -374,8 +371,6 @@ namespace ReactiveTests.Tests
 
         #region - CreateAsync -
 
-#if !NO_TPL
-
         [Fact]
         public void CreateAsync_ArgumentChecking()
         {
@@ -1057,8 +1052,6 @@ namespace ReactiveTests.Tests
             Assert.True(lst.Take(10).SequenceEqual(Enumerable.Repeat(42, 10)));
         }
 
-#endif
-
         #endregion
 
         #region + Defer +
@@ -1193,8 +1186,6 @@ namespace ReactiveTests.Tests
 
         #region - DeferAsync -
 
-#if !NO_TPL
-
         [Fact]
         public void DeferAsync_ArgumentChecking()
         {
@@ -1250,8 +1241,6 @@ namespace ReactiveTests.Tests
             }
         }
 
-#endif
-
         #endregion
 
         #region + Empty +
@@ -2457,8 +2446,6 @@ namespace ReactiveTests.Tests
 
         #region - UsingAsync -
 
-#if !NO_TPL
-
         [Fact]
         public void UsingAsync_ArgumentChecking()
         {
@@ -2587,8 +2574,6 @@ namespace ReactiveTests.Tests
             }
         }
 
-#endif
-
         #endregion
     }
 }

+ 0 - 5
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableExtensionsTest.cs

@@ -9,7 +9,6 @@ using System.Reactive.Linq;
 using System.Threading;
 using Microsoft.Reactive.Testing;
 using Xunit;
-using System.Collections.Generic;
 
 namespace ReactiveTests.Tests
 {
@@ -120,8 +119,6 @@ namespace ReactiveTests.Tests
 
         #region Subscribe with CancellationToken
 
-#if !NO_TPL
-
         [Fact]
         public void Subscribe_CT_ArgumentChecking()
         {
@@ -387,8 +384,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#endif
-
         #endregion
     }
 }

+ 1 - 6
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableImperativeTest.cs

@@ -9,14 +9,11 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -24,7 +21,6 @@ namespace ReactiveTests.Tests
     {
         #region ForEachAsync
 
-#if !NO_TPL
         [Fact]
         public void ForEachAsync_ArgumentChecking()
         {
@@ -545,7 +541,6 @@ namespace ReactiveTests.Tests
                 }
             }
         }
-#endif
 
         [Fact]
         public void ForEachAsync_SubscribeThrows()

+ 4 - 22
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableMultipleTest.cs

@@ -10,15 +10,12 @@ using System.Reactive;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using System.Reactive.Subjects;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -6626,7 +6623,6 @@ namespace ReactiveTests.Tests
 #endif
 #endif
 
-#if !NO_TPL
         [Fact]
         public void Concat_Task()
         {
@@ -6636,7 +6632,6 @@ namespace ReactiveTests.Tests
 
             Assert.True(res.SequenceEqual(new[] { 1, 2, 3 }));
         }
-#endif
 
         #endregion
 
@@ -6659,10 +6654,7 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge(new IObservable<int>[0], default(IScheduler)));
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge((IObservable<IObservable<int>>)null));
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge(DummyScheduler.Instance, (IObservable<int>[])null));
-
-#if !NO_TPL
-            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge((IObservable<System.Threading.Tasks.Task<int>>)null));
-#endif
+            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge((IObservable<Task<int>>)null));
         }
 
         [Fact]
@@ -7728,10 +7720,7 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Merge(default(IObservable<IObservable<int>>), 1));
             ReactiveAssert.Throws<ArgumentOutOfRangeException>(() => Observable.Merge(DummyObservable<IObservable<int>>.Instance, 0));
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Concat(default(IObservable<IObservable<int>>)));
-
-#if !NO_TPL
-            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Concat(default(IObservable<System.Threading.Tasks.Task<int>>)));
-#endif
+            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Concat(default(IObservable<Task<int>>)));
         }
 
         [Fact]
@@ -8335,7 +8324,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if !NO_TPL
         [Fact]
         public void Merge_Task()
         {
@@ -8587,7 +8575,6 @@ namespace ReactiveTests.Tests
 
             Assert.Same(ex, err);
         }
-#endif
 
         #endregion
 
@@ -9683,10 +9670,7 @@ namespace ReactiveTests.Tests
         public void Switch_ArgumentChecking()
         {
             ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Switch((IObservable<IObservable<int>>)null));
-
-#if !NO_TPL
-            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Switch((IObservable<System.Threading.Tasks.Task<int>>)null));
-#endif
+            ReactiveAssert.Throws<ArgumentNullException>(() => Observable.Switch((IObservable<Task<int>>)null));
         }
 
         [Fact]
@@ -9983,7 +9967,6 @@ namespace ReactiveTests.Tests
 #endif
         }
 
-#if !NO_TPL
         [Fact]
         public void Switch_Task()
         {
@@ -9993,7 +9976,6 @@ namespace ReactiveTests.Tests
 
             Assert.True(res.Zip(res.Skip(1), (l, r) => r > l).All(b => b));
         }
-#endif
 
         #endregion
 

+ 2 - 11
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableStandardQueryOperatorTest.cs

@@ -11,15 +11,12 @@ using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Reactive.Subjects;
 using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading;
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -13964,7 +13961,6 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => DummyObservable<int>.Instance.SelectMany(DummyFunc<int, IObservable<int>>.Instance, ((Func<int, int, int>)null)));
             ReactiveAssert.Throws<ArgumentNullException>(() => DummyObservable<int>.Instance.SelectMany(DummyFunc<int, IObservable<int>>.Instance, DummyFunc<int, int, int>.Instance).Subscribe(null));
 
-#if !NO_TPL
             ReactiveAssert.Throws<ArgumentNullException>(() => ((IObservable<int>)null).SelectMany<int, int, int>(DummyFunc<int, Task<int>>.Instance, DummyFunc<int, int, int>.Instance));
             ReactiveAssert.Throws<ArgumentNullException>(() => DummyObservable<int>.Instance.SelectMany((Func<int, Task<int>>)null, DummyFunc<int, int, int>.Instance));
             ReactiveAssert.Throws<ArgumentNullException>(() => DummyObservable<int>.Instance.SelectMany(DummyFunc<int, Task<int>>.Instance, ((Func<int, int, int>)null)));
@@ -13978,7 +13974,6 @@ namespace ReactiveTests.Tests
 
             ReactiveAssert.Throws<ArgumentNullException>(() => ((IObservable<int>)null).SelectMany<int, int>(DummyFunc<int, CancellationToken, Task<int>>.Instance));
             ReactiveAssert.Throws<ArgumentNullException>(() => DummyObservable<int>.Instance.SelectMany((Func<int, CancellationToken, Task<int>>)null));
-#endif
         }
 
         [Fact]
@@ -16038,8 +16033,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if !NO_TPL
-
         [Fact]
         public void SelectMany_Task_ArgumentChecking()
         {
@@ -17840,8 +17833,6 @@ namespace ReactiveTests.Tests
             Assert.Equal(0, m);
         }
 
-#endif
-
         #endregion
 
         #region + Skip +

+ 1 - 6
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Subjects/ReplaySubjectTest.cs

@@ -9,14 +9,11 @@ using System.Reactive;
 using System.Reactive.Concurrency;
 using System.Reactive.Subjects;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -1947,7 +1944,6 @@ namespace ReactiveTests.Tests
             Assert.True(xs.Count == 2);
         }
 
-#if !NO_TPL
         [Fact]
         public void FastImmediateObserver_Ownership1()
         {
@@ -2022,7 +2018,6 @@ namespace ReactiveTests.Tests
 
             Assert.True(xs.Count == 3);
         }
-#endif
 
         private IEnumerable<Recorded<Notification<int>>> FastImmediateObserverTest(Action<IScheduledObserver<int>> f)
         {

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/TaskObservableExtensionsTest.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL
 using System;
 using System.Linq;
 using System.Reactive;
@@ -889,4 +888,3 @@ namespace ReactiveTests.Tests
         #endregion
     }
 }
-#endif