Version Used: VS 18.0.0 Insiders [11123.170]
Steps to Reproduce:
Invoke the lightbulb menu and select "Generate method 'M2'".
unsafe class C
{
private void M()
{
delegate* managed<void> x = &M2;
}
}
Expected Behavior:
The method is generated with the static modifier.
Actual Behavior:
The method is generated without the static modifier, leading to an error:
unsafe class C
{
private void M()
{
delegate* managed<void> x = &M2; // CS8759: Cannot create a function pointer for 'C.M2()' because it is not a static method
}
private void M2()
{
throw new NotImplementedException();
}
}
Version Used: VS 18.0.0 Insiders [11123.170]
Steps to Reproduce:
Invoke the lightbulb menu and select "Generate method 'M2'".
Expected Behavior:
The method is generated with the
staticmodifier.Actual Behavior:
The method is generated without the
staticmodifier, leading to an error: