You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like this is caused by different nullability contexts (generated files have different nullability context that's why you couldn't repro without source generators probably). Can reproduce with something as simple as:
Results in this IL (notice the duplicate .override method):
.class private auto ansi beforefieldinit C
extends [System.Runtime]System.Object
implements class IInterface`1<class C>{// Methods.method public hidebysig staticvoid M ()cilmanaged{.override method voidclass IInterface`1<class C>::M().override method void class IInterface`1<class C>::M()// Method begins at RVA 0x2050// Code size 1 (0x1).maxstack 8
IL_0000: ret
}// end of method C::M
Version Used:
Roslyn v4.9.2
Steps to Reproduce:
static abstract
methodNote
Using a source generator is an essential step. Copying the code into regular .cs files will not trigger this bug.
Repro: https://github.com/viceroypenguin/CompilerBug
Expected Behavior:
The generated assembly will be a valid legal assembly.
Actual Behavior:
The generated assembly is invalid and will fail when attempting to call
Assembly.GetExportedTypes()
.Specifically, in the linked repro, the generated assembly will have two
.override method
modifiers on theValidate
method.The text was updated successfully, but these errors were encountered: