-
Notifications
You must be signed in to change notification settings - Fork 128
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
[release/6.0.2xx] Propagate Interfaces annotation through Type.BaseType #2476
Conversation
The Interfaces annotation makes sure the type has all interfaces, meaning `GetInterfaces` reflection call will work on it. That means that all interfaces of the base type are also preserved, so the `Interfaces` annotation should be propagated to the base type as well.
@@ -1294,6 +1294,9 @@ public override bool HandleCall (MethodBody callingMethodBody, MethodReference c | |||
|
|||
if (dynamicallyAccessedMemberNode.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.PublicProperties)) | |||
propagatedMemberTypes |= DynamicallyAccessedMemberTypes.PublicProperties; | |||
|
|||
if (dynamicallyAccessedMemberNode.DynamicallyAccessedMemberTypes.HasFlag (DynamicallyAccessedMemberTypes.Interfaces)) | |||
propagatedMemberTypes |= DynamicallyAccessedMemberTypes.Interfaces; |
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.
Consider creating a mask here and &'ing, instead of checking each flag individually.
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.
Also, whether inclusion of exclusion is preferred, i.e. if we forget to update this, would we prefer to propagate more or less?
…pe (dotnet/linker#2476) The Interfaces annotation makes sure the type has all interfaces, meaning `GetInterfaces` reflection call will work on it. That means that all interfaces of the base type are also preserved, so the `Interfaces` annotation should be propagated to the base type as well. Commit migrated from dotnet/linker@5b33e3a
The Interfaces annotation makes sure the type has all interfaces, meaning
GetInterfaces
reflection call will work on it. That means that all interfaces of the base type are also preserved, so theInterfaces
annotation should be propagated to the base type as well.Fixes #2473.