SharpLab
SharpLab copied to clipboard
DefaultInterpolatedStringHandler throws VerificationException in Run mode
using System.Runtime.CompilerServices;
Test($"{123}");
Test($"""{123}""");
static void Test(ref DefaultInterpolatedStringHandler expected)
{
}
The above code throws a VerificationException when in Run mode:
System.Security.VerificationException: Method SharpLab.Runtime.Internal.Flow.ReportRefValue: type argument 'System.Runtime.CompilerServices.DefaultInterpolatedStringHandler' violates the constraint of type parameter 'T'.
at Program.<<Main>$>g__Test|0_0(DefaultInterpolatedStringHandler& expected)
at Program.<Main>$(String[] args)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
However, the code compiles (and execute just fine using something other than sharplab).