Description
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 SymbolValue
s 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.