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
The shortcut .override Class::Method ILASM syntax is generating unresolvable MemberRefs for covariant returns (only the more wordy .override method instance ReturnType Class::Method(Param1, Param2) syntax works).
ILDASM generates the shortcut syntax, things don't roundtrip. I found this when I was playing with this in the linker yesterday.
To repro, e.g. take the CompatibleWith.il test, ILASM it, then ILDASM it and ILASM it again.
After the first ILDASM:
.method /*06000009*/ public hidebysig newslot virtual
instance class [System.Runtime/*23000003*/]System.Collections.Generic.IList`1/*01000002*/<int32>
M1() cil managed
{
.override C1/*02000004*/::M1 /*02000004::06000002*/
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method C2::M1
After the second ILDASM:
.method /*06000009*/ public hidebysig newslot virtual
instance class [System.Runtime/*23000003*/]System.Collections.Generic.IList`1/*01000002*/<int32>
M1() cil managed
{
.override C1/*01000006*/::M1 /*01000006::0A00000D*/
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method C2::M1
Notice that the .override is actually using MemberRefs in the second disassembly and I don't think the MemberRefs actually resolve (didn't try with Fadi's/Jan's branch, but I don't think it will work).
@MichalStrehovsky Someone working on the covariant return feature needs to own this implementation (and take ownership of this bug). Who would that be?
The shortcut
.override Class::Method
ILASM syntax is generating unresolvable MemberRefs for covariant returns (only the more wordy.override method instance ReturnType Class::Method(Param1, Param2)
syntax works).ILDASM generates the shortcut syntax, things don't roundtrip. I found this when I was playing with this in the linker yesterday.
To repro, e.g. take the CompatibleWith.il test, ILASM it, then ILDASM it and ILASM it again.
After the first ILDASM:
After the second ILDASM:
Notice that the
.override
is actually using MemberRefs in the second disassembly and I don't think the MemberRefs actually resolve (didn't try with Fadi's/Jan's branch, but I don't think it will work).The MemberRef token is defined as this:
Notice the return type.
It's also weird there's no warning about this from ILASM, but that's a preexisting issue I guess.
The text was updated successfully, but these errors were encountered: