-
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
ilasm does not apply multiple custom attributes on interface implementations #82373
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsDescriptionI believe the following code:
is supposed to apply two attributes on the interface implementation. When round-tripped through
Which means:
The In addition, note that the following code produces the desired effect in
But in that case,
Which doesn't round-trip. Reproduction StepsHere is a test file,
Expected behavior
Actual behavior
Regression?Not as far as I can tell. Known WorkaroundsRepeat No workaround for the round-trip inconsistency though. ConfigurationTested with
(why are the v7.0.0 packages empty BTW?) Other informationNo response
|
cc @TIHan, PTAL. |
Will look at this tomorrow. |
Description
I believe the following code:
is supposed to apply two attributes on the interface implementation.
When round-tripped through
ilasm
/ildasm
, this code is turned into:Which means:
Test1Attribute
is applied on the interface implementation (metadata table09
)Test2Attribute
is applied on the type definition (metadata table02
)The
CustomAttribute
metadata table shows thatildasm
is correct here:In addition, note that the following code produces the desired effect in
ilasm
:But in that case,
ildasm
decompiles it to:Which doesn't round-trip.
Reproduction Steps
Here is a test file,
Test.il
:ilasm /DLL Test.il
ildasm /OUT=TestOut.il Test.dll
Expected behavior
Test1Attribute
andTest2Attribute
should be applied on the interface implementation (metadata table09
:InterfaceImpl
)ilasm
/ildasm
Actual behavior
Test1Attribute
is applied on the interface implementation (metadata table09
:InterfaceImpl
)Test2Attribute
is applied on the type definition (metadata table02
:TypeDef
)Regression?
Not as far as I can tell.
Known Workarounds
Repeat
.interfaceimpl type
for each.custom instance
to apply the custom attribute to the interface implementation.No workaround for the round-trip inconsistency though.
Configuration
Tested with
ilasm
/ildasm
from:Microsoft.NETCore.ILAsm
/Microsoft.NETCore.ILDAsm
NuGet packages v6.0.0(why are the v7.0.0 packages empty BTW?)
Other information
No response
The text was updated successfully, but these errors were encountered: