Description
NativeAOT will bypass warning generation for Requires if it's embedded in a custom attribute. The usage of the custom attribute should generate a warning
Reproduction Steps
publicclassRequiresOnAttributeCtorAttribute:Attribute{[RequiresUnreferencedCode("Message from attribute's ctor.")]publicRequiresOnAttributeCtorAttribute(){}}[RequiresUnreferencedCode("Message from attribute's type.")]publicclassRequiresOnAttributeTypeAttribute:Attribute{}// Not generated warnings:// [ExpectedWarning ("IL2026", "Message from attribute's ctor.")]// [ExpectedWarning ("IL2026", "Message from attribute's type.")][RequiresOnAttributeCtor][RequiresOnAttributeType]publicvoidMethod(){}Expected behavior
Warnings are generated when accessing a custom attribute with members annotated with Requires
Actual behavior
Warnings are not generated when accessing a custom attribute with members annotated with Requires
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
NativeAOT will bypass warning generation for Requires if it's embedded in a custom attribute. The usage of the custom attribute should generate a warning
Reproduction Steps
Expected behavior
Warnings are generated when accessing a custom attribute with members annotated with Requires
Actual behavior
Warnings are not generated when accessing a custom attribute with members annotated with Requires
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response