Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultInterpolatedStringHandler throws VerificationException in Run mode #1341

Open
JakeYallop opened this issue Aug 22, 2024 · 0 comments
Open

Comments

@JakeYallop
Copy link

sharplab

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant