Skip to content

[DAM analyzer] Report warnings for annotations on unsupported types #2409

Closed
@sbomer

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.

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