diff --git a/src/ReactiveUI.Tests/ReactiveObject/Mocks/OaphNameOfTestFixture.cs b/src/ReactiveUI.Tests/ReactiveObject/Mocks/OaphNameOfTestFixture.cs index 1f4239622f..1374125741 100644 --- a/src/ReactiveUI.Tests/ReactiveObject/Mocks/OaphNameOfTestFixture.cs +++ b/src/ReactiveUI.Tests/ReactiveObject/Mocks/OaphNameOfTestFixture.cs @@ -19,8 +19,9 @@ public class OaphNameOfTestFixture : TestFixture public OaphNameOfTestFixture() { this.WhenAnyValue(x => x.IsOnlyOneWord).Select(x => x ?? string.Empty).Select(x => x.Length >= 3 ? x.Substring(0, 3) : x).ToProperty(this, nameof(FirstThreeLettersOfOneWord), out _firstThreeLettersOfOneWord); - +#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type. _lastThreeLettersOfOneWord = this.WhenAnyValue(x => x.IsOnlyOneWord).Select(x => x ?? string.Empty).Select(x => x.Length >= 3 ? x.Substring(x.Length - 3, 3) : x).ToProperty(this, nameof(LastThreeLettersOfOneWord)); +#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type. } [IgnoreDataMember] diff --git a/src/ReactiveUI.Tests/Routing/Mocks/TestScreen.cs b/src/ReactiveUI.Tests/Routing/Mocks/TestScreen.cs index ff8d64ecf5..87adfc9202 100644 --- a/src/ReactiveUI.Tests/Routing/Mocks/TestScreen.cs +++ b/src/ReactiveUI.Tests/Routing/Mocks/TestScreen.cs @@ -18,7 +18,9 @@ public class TestScreen : ReactiveObject, IScreen public RoutingState? Router { #pragma warning disable CS8766 // Nullability of reference types in return type doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member. get => _router; +#pragma warning restore CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member. #pragma warning restore CS8766 // Nullability of reference types in return type doesn't match implicitly implemented member (possibly because of nullability attributes). set => this.RaiseAndSetIfChanged(ref _router, value); } diff --git a/src/ReactiveUI.Tests/WhenAny/WhenAnyObservableTests.cs b/src/ReactiveUI.Tests/WhenAny/WhenAnyObservableTests.cs index 8947ae2699..c65cc173de 100644 --- a/src/ReactiveUI.Tests/WhenAny/WhenAnyObservableTests.cs +++ b/src/ReactiveUI.Tests/WhenAny/WhenAnyObservableTests.cs @@ -25,6 +25,7 @@ public void NullObservablesDoNotCauseExceptions() fixture.Command1 = null; // these are the overloads of WhenAnyObservable that perform a Merge +#pragma warning disable CS8603 // Possible null reference return. fixture.WhenAnyObservable(x => x.Command1).Subscribe(); fixture.WhenAnyObservable(x => x.Command1, x => x.Command1).Subscribe(); fixture.WhenAnyObservable(x => x.Command1, x => x.Command1, x => x.Command1).Subscribe(); @@ -48,6 +49,7 @@ public void NullObservablesDoNotCauseExceptions() fixture.WhenAnyObservable(x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, (zero, one, two, three, four, five, six, seven, eight) => Unit.Default).Subscribe(); fixture.WhenAnyObservable(x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, (zero, one, two, three, four, five, six, seven, eight, nine) => Unit.Default).Subscribe(); fixture.WhenAnyObservable(x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, x => x.Command1, (zero, one, two, three, four, five, six, seven, eight, nine, ten) => Unit.Default).Subscribe(); +#pragma warning restore CS8603 // Possible null reference return. } [Fact] @@ -56,7 +58,9 @@ public async Task WhenAnyObservableSmokeTestCombining() var fixture = new TestWhenAnyObsViewModel(); var list = new List(); +#pragma warning disable CS8603 // Possible null reference return. fixture.WhenAnyObservable(x => x.Command3, x => x.Command1, (s, i) => s + " : " + i).ObserveOn(ImmediateScheduler.Instance).Subscribe(list.Add); +#pragma warning restore CS8603 // Possible null reference return. Assert.Equal(0, list.Count); @@ -86,7 +90,9 @@ public async Task WhenAnyObservableSmokeTestMerging() var fixture = new TestWhenAnyObsViewModel(); var list = new List(); +#pragma warning disable CS8603 // Possible null reference return. fixture.WhenAnyObservable(x => x.Command1, x => x.Command2).ObserveOn(ImmediateScheduler.Instance).Subscribe(list.Add); +#pragma warning restore CS8603 // Possible null reference return. Assert.Equal(0, list.Count); @@ -113,7 +119,9 @@ public async Task WhenAnyObservableSmokeTestMerging() public void WhenAnyObservableWithNullObjectShouldUpdateWhenObjectIsntNullAnymore() { var fixture = new TestWhenAnyObsViewModel(); +#pragma warning disable CS8603 // Possible null reference return. fixture.WhenAnyObservable(x => x.Changes).Bind(out var output).ObserveOn(ImmediateScheduler.Instance).Subscribe(); +#pragma warning restore CS8603 // Possible null reference return. Assert.Equal(0, output.Count); diff --git a/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs b/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs index de999eff51..6577a7e237 100644 --- a/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs +++ b/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs @@ -178,7 +178,9 @@ private IDisposable ScheduleSlow(TState state, TimeSpan dueTime, Func(out TValue changeValue, o Expression lastExpression = expressions.Last(); #pragma warning disable CS8601 // Possible null reference assignment. +#pragma warning disable CS8605 // Unboxing a possibly null value. changeValue = (TValue)GetValueFetcherOrThrow(lastExpression.GetMemberInfo())(current, lastExpression.GetArgumentsArray()); +#pragma warning restore CS8605 // Unboxing a possibly null value. #pragma warning restore CS8601 // Possible null reference assignment. return true; }