Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sbomer opened this issue Nov 30, 2021 · 1 comment
Closed

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

sbomer opened this issue Nov 30, 2021 · 1 comment

Comments

@sbomer
Copy link
Member

sbomer commented Nov 30, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants