diff options
author | Santiago Fernandez Madero <safern@microsoft.com> | 2019-06-27 10:39:13 -0700 |
---|---|---|
committer | Santiago Fernandez Madero <safern@microsoft.com> | 2019-06-27 11:00:20 -0700 |
commit | b5ccdc3d9b9c8f6020e9c458e19a8504eb845910 (patch) | |
tree | 81ffe76ea2b0f618711c9ef2bdcdf462ffc937a9 /src/System.Private.CoreLib/shared/System/Threading/Tasks | |
parent | cca3d1eeb41450a85a70bb48d3bb11091dc010bd (diff) | |
download | coreclr-b5ccdc3d9b9c8f6020e9c458e19a8504eb845910.tar.gz coreclr-b5ccdc3d9b9c8f6020e9c458e19a8504eb845910.tar.bz2 coreclr-b5ccdc3d9b9c8f6020e9c458e19a8504eb845910.zip |
React to new compiler nullability warnings
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Threading/Tasks')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs | 3 |
1 files changed, 2 insertions, 1 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 a7de15a0d5..6464676b1b 100644 --- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs +++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs @@ -1260,7 +1260,7 @@ namespace System.Threading.Tasks // Grab the relevant state and then null it out so that the task doesn't hold onto the state unnecessarily var thisRef = promise!.m_thisRef; // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected var endMethod = promise.m_endMethod; - promise.m_thisRef = default!; // TODO-NULLABLE: Remove ! when nullable attributes are respected + promise.m_thisRef = default; promise.m_endMethod = null; if (endMethod == null) ThrowHelper.ThrowArgumentException(ExceptionResource.InvalidOperation_WrongAsyncResultOrEndCalledMultiple, ExceptionArgument.asyncResult); @@ -1268,6 +1268,7 @@ namespace System.Threading.Tasks // we'll instead complete the promise at the call site. if (!asyncResult.CompletedSynchronously) { + Debug.Assert(thisRef != null); promise.Complete(thisRef, endMethod!, asyncResult, requiresSynchronization: true); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected } } |