From d592209211dcf096e88e22689602a04ac87c6dd7 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Tue, 25 Jul 2017 03:23:50 +0100 Subject: [PATCH] ValueTask .ctor throw to Helper --- src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs | 7 ++++++- src/mscorlib/src/System/ThrowHelper.cs | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs b/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs index bafc8f5..4953880 100644 --- a/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs +++ b/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs @@ -71,7 +71,12 @@ namespace System.Threading.Tasks /// The task. public ValueTask(Task task) { - _task = task ?? throw new ArgumentNullException(nameof(task)); + if (task == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.task); + } + + _task = task; _result = default(TResult); } diff --git a/src/mscorlib/src/System/ThrowHelper.cs b/src/mscorlib/src/System/ThrowHelper.cs index ff76738..b4fc5a8 100644 --- a/src/mscorlib/src/System/ThrowHelper.cs +++ b/src/mscorlib/src/System/ThrowHelper.cs @@ -416,7 +416,8 @@ namespace System type, stateMachine, pHandle, - values + values, + task } // -- 2.7.4