-
Notifications
You must be signed in to change notification settings - Fork 507
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
SA1121: Inconsistent behaviour with respect to global using aliases #3594
Comments
SA1121 takes a shortcut when it doesn't detect any using alias statements in the file, so I assume that it doesn't detect global using aliases from other files. |
I haven't been able to find a way to fix this in the current implementation, short of turning off the optimization that I mentioned before. I posted a question to the Roslyn team (dotnet/roslyn#66517) to see if they see a way forward. |
This is also related to #2975 (comment) where @sharwell has suggested to rewrite SA1121 as an operation analyzer to improve performance. This problem might go away if that is implemented. |
…ntax tree, by filling the dictionary directly when it is created. In the previous commit, it was checked for global using aliases once and then again for normal using aliases. DotNetAnalyzers#3594
…ntax tree, by filling the dictionary directly when it is created. In the previous commit, it was checked for global using aliases once and then again for normal using aliases. DotNetAnalyzers#3594
…symbols returned by the wrapper DotNetAnalyzers#3594
If a global using alias is defined in another file, SA1121 does not produce a warning.
For example, the analyzer will not produce a warning in NoWarning.cs, but in AWarning.cs it does:
GlobalUsings.cs:
NoWarning.cs:
AWarning.cs:
The text was updated successfully, but these errors were encountered: