ValidateToken(token);
if (!_completed)
{
- ManualResetValueTaskSourceCoreShared.ThrowInvalidOperationException();
+ ThrowHelper.ThrowInvalidOperationException();
}
_error?.Throw();
// Operation already completed, so we need to queue the supplied callback.
if (!ReferenceEquals(oldContinuation, ManualResetValueTaskSourceCoreShared.s_sentinel))
{
- ManualResetValueTaskSourceCoreShared.ThrowInvalidOperationException();
+ ThrowHelper.ThrowInvalidOperationException();
}
switch (_capturedContext)
{
if (token != _version)
{
- ManualResetValueTaskSourceCoreShared.ThrowInvalidOperationException();
+ ThrowHelper.ThrowInvalidOperationException();
}
}
{
if (_completed)
{
- ManualResetValueTaskSourceCoreShared.ThrowInvalidOperationException();
+ ThrowHelper.ThrowInvalidOperationException();
}
_completed = true;
internal static class ManualResetValueTaskSourceCoreShared // separated out of generic to avoid unnecessary duplication
{
- [StackTraceHidden]
- internal static void ThrowInvalidOperationException() => throw new InvalidOperationException();
-
internal static readonly Action<object> s_sentinel = CompletionSentinel;
private static void CompletionSentinel(object _) // named method to aid debugging
{
Debug.Fail("The sentinel delegate should never be invoked.");
- ThrowInvalidOperationException();
+ ThrowHelper.ThrowInvalidOperationException();
}
}
}
throw GetArgumentOutOfRangeException(argument, paramNumber, resource);
}
+ internal static void ThrowInvalidOperationException()
+ {
+ throw new InvalidOperationException();
+ }
+
internal static void ThrowInvalidOperationException(ExceptionResource resource)
{
throw GetInvalidOperationException(resource);