Description
The Roslyn analyzer needs to be able to produce warnings for reflection-access to reflection-annotated methods. Whenever we see a reflection pattern that accesses, for example, PublicMethods
on a particular type, we need to be able to find all public methods on the type.
The binding logic from https://github.com/dotnet/linker/blob/main/src/linker/Linker.Dataflow/DynamicallyAccessedMembersBinder.cs should be ported to work with Roslyn, and made to produce these warnings. To do this, I would start by enabling a few tests from https://github.com/dotnet/linker/blob/main/test/Mono.Linker.Tests.Cases/DataFlow/AnnotatedMembersAccessedViaReflection.cs in the feature/damAnalyzer
branch (which has early support for DynamicallyAccessedMembersAttribute).