Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

[DAM analyzer] Port DAM binding logic to analyzer #2339

Closed

Description

@sbomer

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).

Activity

  1. changed the title [-]Port DAM binding logic to analyzer[/-] [+][DAM analyzer] Port DAM binding logic to analyzer[/+] on Oct 27, 2021
  2. self-assigned this
    on Oct 27, 2021
  3. sbomer commented on Jan 18, 2022

    @sbomer
    MemberAuthor

    The binding logic has been ported, so the remaining work is to turn it on and produce warnings for reflection access to annotated members (#2418).

  4. tlakollo commented on Feb 6, 2022

    @tlakollo
    Contributor

    This should be working now, closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions