-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Adding warnings to make generic and static ctor #56628
Conversation
src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
Outdated
Show resolved
Hide resolved
...aries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent looks good to me. I'll defer to @eerhardt on the specifics of OOB assemblies and alike, so please make sure you get a sign-off from him as well.
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
Outdated
Show resolved
Hide resolved
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr Issue DetailsThe trimmer already has intrinsic to analyze annotations for generic types in Suppressed the warning on Fixes #53121
|
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
The trimmer already has intrinsic to analyze annotations for generic types in
MakeGenericType/Method
and warns if a type is not statically known. Adding the matchedRequiresUnreferencedCodeAttribute
toMakeGenericType/Method
in Type andMethodInfo
in the runtime library and propagated the warnings in the library code.Suppressed the warning on
DispatchProxyGenerator
since its trim-safe. The existing trimmer behavior does not change for known input types with this change. Also addedRequiresUnreferencedCodeAttribute
to theRunClassConstructor
since the trimmer cannot guarantee existence of a static ctor.Fixes #53121