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
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Don't consider static field on bases to be in hierarchy #2020
As I was experimenting with dotnet/runtime#52535, I found out the reflection stack doesn't consider inherited static fields to be visible on the current type (typeof(Derived).GetField("SomeFieldFromBase", BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance) will not see the field on the base type unless it's an non-private instance field).
We can use this to restrict this search and allow more trimming:
Activity
MichalStrehovsky commentedon May 10, 2021
Cc @vitek-karas
vitek-karas commentedon May 11, 2021
I think it's important to note that this is only true if the call didn't specify
BindingFlags.FlattenHierarchy.This prints out:
MichalStrehovsky commentedon May 11, 2021
Let's close since dotnet/runtime#102525 tracks the actual work needed.