-
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
DynamicallyAccessedMemberTypes.Interfaces does not cover GetInterfaces on base type #2473
Comments
Good catch - #2476 has the fix, we'll try to take it for 6.0.2xx. |
Fixed by #2476 for 6.0.2xx. |
@vitek-karas I'm running into this for DynamicallyAccessedMemberTypes.PublicFields - can you confirm that this (and other relevant annotations) are also propagated via BaseType? |
Almost all public members should be propagated. The code for this is here: linker/src/linker/Linker.Dataflow/ReflectionMethodBodyScanner.cs Lines 1275 to 1298 in 89ae0f0
Private member annotations are not propagated, because that's how reflection works. Meaning calling Type.GetMethods() (with any combination of binding flags) will never return private members on the base type. The annotations were designed to follow the same semantics as reflection binding. |
Perfect, thanks @vitek-karas! |
Note: Everything but the Interfaces should already work in 6.0... so if you see anything different, please let us know. |
The following method causes what seems to be a false positive trim analysis warning:
The call of GetInterfaces() on type.BaseType triggers:
If all interfaces on
type
are preserved, all interfaces on its base type should be preserved as well. There may be a similar issue with other DynamicallyAccessedMemberTypes members as well.The text was updated successfully, but these errors were encountered: