diff options
author | Stephen Toub <stoub@microsoft.com> | 2019-04-06 20:17:57 -0400 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2019-04-07 07:38:29 -0400 |
commit | 71b9c5cdb1160bdafe8e09a9a0f5670e0988dea5 (patch) | |
tree | 311f5d7f0809b7aa1dd56868e93196014bfbc3f9 /src/System.Private.CoreLib/shared/System/Threading/Tasks | |
parent | e11818cd5c25a256a0b85a4a686ed64dc0c8462a (diff) | |
download | coreclr-71b9c5cdb1160bdafe8e09a9a0f5670e0988dea5.tar.gz coreclr-71b9c5cdb1160bdafe8e09a9a0f5670e0988dea5.tar.bz2 coreclr-71b9c5cdb1160bdafe8e09a9a0f5670e0988dea5.zip |
Fix two new nullable warnings with latest compiler
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Threading/Tasks')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs | 2 | ||||
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs index c8145d87c6..e96fe14b34 100644 --- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs +++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs @@ -683,7 +683,7 @@ namespace System.Threading.Tasks asyncResult.AsyncWaitHandle, delegate { - try { t.InternalRunSynchronously(scheduler, waitForCompletion: false); } + try { t.InternalRunSynchronously(scheduler!, waitForCompletion: false); } // TODO-NULLABLE: https://github.com/dotnet/csharplang/issues/538 catch (Exception e) { promise.TrySetException(e); } // catch and log any scheduler exceptions }, null, diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs index a8aac04936..2c35214248 100644 --- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs +++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs @@ -4477,7 +4477,8 @@ namespace System.Threading.Tasks // Task is completed. Nothing to do here. if (continuationsLocalRef == s_taskCompletionSentinel) return; - if (!(continuationsLocalRef is List<object?> continuationsLocalListRef)) + List<object?>? continuationsLocalListRef = continuationsLocalRef as List<object?>; + if (continuationsLocalListRef is null) { // This is not a list. If we have a single object (the one we want to remove) we try to replace it with an empty list. // Note we cannot go back to a null state, since it will mess up the AddTaskContinuation logic. |