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
Descriptor files allow keeping members that otherwise the ilc compiler would have stripped. During this process it inserts nodes (reflectable fields, reflectable methods, etc.) this will indeed keep the members in the final assembly. What the ilc compiler is missing is the generation of warnings when the keep members produce dangerous code.
Reproduction Steps
C# code: Assume the RequiresOnFieldOnlyViaDescriptor class is not going to be kept by the compiler since is never called
[RequiresUnreferencedCode("Message for --RequiresOnFieldOnlyViaDescriptor--")]classRequiresOnFieldOnlyViaDescriptor{publicstaticintField;}
The ilc compiler should keep the type, the field and warn about the Requires Attribute since the field is static and the class is annotated with RequiresUnreferencedCode
Actual behavior
The type is kept, the field is kept but no warning is produced
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
Descriptor files allow keeping members that otherwise the ilc compiler would have stripped. During this process it inserts nodes (reflectable fields, reflectable methods, etc.) this will indeed keep the members in the final assembly. What the ilc compiler is missing is the generation of warnings when the keep members produce dangerous code.
Reproduction Steps
C# code: Assume the RequiresOnFieldOnlyViaDescriptor class is not going to be kept by the compiler since is never called
XML descriptor keeps the type and the field
Expected behavior
The ilc compiler should keep the type, the field and warn about the Requires Attribute since the field is static and the class is annotated with RequiresUnreferencedCode
Actual behavior
The type is kept, the field is kept but no warning is produced
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: