Skip to content

DefaultInterpolatedStringHandler throws VerificationException in Run mode #1341

Open

Description

@JakeYallop

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions