summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Threading/Tasks
diff options
context:
space:
mode:
authorSantiago Fernandez Madero <safern@microsoft.com>2019-06-27 10:39:13 -0700
committerSantiago Fernandez Madero <safern@microsoft.com>2019-06-27 11:00:20 -0700
commitb5ccdc3d9b9c8f6020e9c458e19a8504eb845910 (patch)
tree81ffe76ea2b0f618711c9ef2bdcdf462ffc937a9 /src/System.Private.CoreLib/shared/System/Threading/Tasks
parentcca3d1eeb41450a85a70bb48d3bb11091dc010bd (diff)
downloadcoreclr-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.cs3
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
}
}