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] Report warnings for annotations on unsupported types #2409

Closed

Description

@sbomer

The analyzer currently tracks annotated locations regardless of the type that's annotated. We should only track annotations on relevant types (like Type or String), and produce warnings if an annotation is found on an invalid location.

A good starting point would be to enable some of the testcases that produce IL2097-IL2099 and IL2106. The fix will involve modifying places where the visitor creates tracked values, for example: https://github.com/dotnet/linker/blob/feature/damAnalyzer/src/ILLink.RoslynAnalyzer/TrimAnalysis/TrimAnalysisVisitor.cs#L38-L41
Here and elsewhere we should only create SymbolValues for supported types, to avoid tracking unnecessary state. Instead unsupported types with annotations should produce warnings, which will need to be deduplicated if we create them from the visitor.

Activity

  1. tlakollo commented on Feb 19, 2022

    @tlakollo
    Contributor

    Closed via #2599

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

Metadata

Metadata

Assignees

No one assigned

    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