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

DynamicallyAccessedMembersBinder port to Analyzer - #2394

Merged
LakshanF merged 4 commits into
dotnet:feature/damAnalyzerfrom
LakshanF:DamBindingPort3
Dec 2, 2021
Merged

LakshanF merged 4 commits into
dotnet:feature/damAnalyzerfrom
LakshanF:DamBindingPort3

Conversation

@LakshanF

@LakshanF LakshanF commented Nov 24, 2021 •

Copy link
Copy Markdown
Contributor

Mostly 1:1 conversion of linker DAM to Analyzer, #2339

@LakshanF
LakshanF requested a review from tlakollo November 24, 2021 00:46
@LakshanF
LakshanF requested a review from sbomer as a code owner November 24, 2021 00:46
@LakshanF
LakshanF requested a review from vitek-karas November 24, 2021 14:29

@sbomer sbomer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the port is looking good! I think we need to turn on at least a few tests from AnnotatedMembersAccessedViaReflection as a sanity check. Would you be able to do the following?

  • Add a new subclass of SingleValue, maybe KnownTypeValue, alongside ValueWithDynamicallyAccessedMembers. Its ctor should take an ITypeSymbol
  • In the visitor, modify VisitTypeOf in the visitor to return a KnownTypeValue
  • Modify GetDynamicallyAccessedMembersDiagnostics to call the binder and report warnings for members which have annotations
    • Maybe it doesn't need to be complete in this change - for example it could be enough to report warnings for members which have RUC - the goal is just to get a few of the tests running as validation.

@LakshanF

LakshanF commented Dec 1, 2021

Copy link
Copy Markdown
Contributor Author

I opened an issue, #2410 to track the test suggestion and assigned to @tlakollo since he has already started to work on enabling tests

@tlakollo tlakollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks Lakshan :D

@LakshanF
LakshanF merged commit a097235 into dotnet:feature/damAnalyzer Dec 2, 2021
@LakshanF
LakshanF deleted the DamBindingPort3 branch December 2, 2021 12:08
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* DynamicallyAccessedMembersBinder port to Analyzer

* FB

* FB2

* better filtering

Commit migrated from dotnet/linker@a097235
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants