Skip to content

Commit dd715a0

Browse files
authored
Tweak assert in AsyncTaskMethodBuilder (#87215)
1 parent a2656af commit dd715a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public ref ExecutionContext? Context
333333
{
334334
get
335335
{
336-
Debug.Assert(m_stateObject is null || m_stateObject is ExecutionContext, $"{nameof(m_stateObject)} must only be for ExecutionContext but contained {m_stateObject}.");
336+
Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}.");
337337
return ref Unsafe.As<object?, ExecutionContext?>(ref m_stateObject);
338338
}
339339
}

0 commit comments

Comments
 (0)