-
Couldn't load subscription status.
- Fork 5.2k
Open
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzersin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Description
Using the Type.GetMember function gives warnings that are not necessary when AOT analysis is enabled.
Reproduction Steps
Enable AOT compatible analysis: <IsAotCompatible>true</IsAotCompatible>.
Write code like so:
void X(Type t)
{
t.GetMember("SomeMethod", MemberTypes.Method, BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic);
}Expected behavior
All that should be necessary to appease the analyser is:
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]Actual behavior
Regression?
No response
Known Workarounds
Ignore the warning.
Configuration
.NET SDK 8.0.0
VS 17.8.0
Windows 10.0.19045 x64
I don't see why it would be specific to this configuration
Other information
This was likely just overlooked when implementing the analyser. I've only discovered it now since I'm only now adding AOT support.
Metadata
Metadata
Assignees
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzersin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Type
Projects
Status
No status
