瀏覽代碼

Merge pull request #1343 from dotnet/dev/bartde/rx_nullable_part7

More trivial nullable goodness.
Bart J.F. De Smet 5 年之前
父節點
當前提交
48133eb4b7

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs

@@ -370,7 +370,7 @@ namespace System.Reactive.Concurrency
         /// </summary>
         /// <param name="args">Currently not used.</param>
         /// <param name="sender">Currently not used.</param>
-        internal virtual void SystemClockChanged(object sender, SystemClockChangedEventArgs args)
+        internal virtual void SystemClockChanged(object? sender, SystemClockChangedEventArgs args)
         {
             lock (StaticGate)
             {

+ 1 - 3
Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.Synchronize.cs

@@ -2,14 +2,12 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Concurrency
 {
     internal sealed class Synchronize<TSource> : Producer<TSource, Synchronize<TSource>._>
     {
         private readonly IObservable<TSource> _source;
-        private readonly object _gate;
+        private readonly object? _gate;
 
         public Synchronize(IObservable<TSource> source, object gate)
         {

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class All<TSource> : Producer<bool, All<TSource>._>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal static class Any<TSource>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class AsObservable<TSource> : Producer<TSource, AsObservable<TSource>._>, IEvaluatableObservable<TSource>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 using System.Collections.Generic;
 
 namespace System.Reactive.Linq.ObservableImpl

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal static class Count<TSource>

+ 4 - 6
Rx.NET/Source/src/System.Reactive/Linq/Observable/ForEach.cs

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 using System.Threading;
 
 namespace System.Reactive.Linq.ObservableImpl
@@ -15,7 +13,7 @@ namespace System.Reactive.Linq.ObservableImpl
             private readonly Action<TSource> _onNext;
             private readonly Action _done;
 
-            private Exception _exception;
+            private Exception? _exception;
             private int _stopped;
 
             public Observer(Action<TSource> onNext, Action done)
@@ -24,7 +22,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _done = done;
             }
 
-            public Exception Error => _exception;
+            public Exception? Error => _exception;
 
             public void OnNext(TSource value)
             {
@@ -65,7 +63,7 @@ namespace System.Reactive.Linq.ObservableImpl
             private readonly Action _done;
 
             private int _index;
-            private Exception _exception;
+            private Exception? _exception;
             private int _stopped;
 
             public ObserverIndexed(Action<TSource, int> onNext, Action done)
@@ -74,7 +72,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _done = done;
             }
 
-            public Exception Error => _exception;
+            public Exception? Error => _exception;
 
             public void OnNext(TSource value)
             {

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class IgnoreElements<TSource> : Producer<TSource, IgnoreElements<TSource>._>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class IsEmpty<TSource> : Producer<bool, IsEmpty<TSource>._>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal static class LongCount<TSource>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class OfType<TSource, TResult> : Producer<TResult, OfType<TSource, TResult>._>

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class SumDouble : Producer<double, SumDouble._>

+ 2 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable/Synchronize.cs

@@ -2,14 +2,12 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class Synchronize<TSource> : Producer<TSource, Synchronize<TSource>._>
     {
         private readonly IObservable<TSource> _source;
-        private readonly object _gate;
+        private readonly object? _gate;
 
         public Synchronize(IObservable<TSource> source, object gate)
         {
@@ -30,7 +28,7 @@ namespace System.Reactive.Linq.ObservableImpl
         {
             private readonly object _gate;
 
-            public _(object gate, IObserver<TSource> observer)
+            public _(object? gate, IObserver<TSource> observer)
                 : base(observer)
             {
                 _gate = gate ?? new object();

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

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#nullable disable
-
 using System.Reactive.Concurrency;
 
 namespace System.Reactive.Linq.ObservableImpl