-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
ILVerification fails unexpectedly on delegate construction #65010
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsDescriptionAssignments of an extension method to Reproduction StepsCompile the following C# code and verify it. The verification fails with: using System;
static class Program
{
static void Main()
{
"ABC".Goo();
Action a = "123".Goo;
a();
a = new Action(a);
a();
a = new Action("xyz".Goo);
a();
}
static void Goo(this string x)
{
Console.WriteLine(x);
}
}
This was found in Roslyn, test: Expected behaviorNo error (ie. same behavior as PEVerify) Actual behaviorUnrecognized arguments for delegate .ctor. { Offset = 21 } Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Description
Assignments of an extension method to
Action
trips ILVerification.Reproduction Steps
Compile the following C# code and verify it.
The verification fails with:
Unrecognized arguments for delegate .ctor. { Offset = 21 } // that's 0x15
Unrecognized arguments for delegate .ctor. { Offset = 59 } // that's 0x3B
This was found in Roslyn, test:
ExtensionMethodTests.ExtensionMethodInTheSameClass
. DiscussionExpected behavior
No error (ie. same behavior as PEVerify)
Actual behavior
Unrecognized arguments for delegate .ctor. { Offset = 21 }
Unrecognized arguments for delegate .ctor. { Offset = 59 }
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: