-
Notifications
You must be signed in to change notification settings - Fork 470
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
Fix DiagnosticAnalyzerFieldsAnalyzer for delegate fields #6724
Fix DiagnosticAnalyzerFieldsAnalyzer for delegate fields #6724
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6724 +/- ##
==========================================
- Coverage 96.32% 96.32% -0.01%
==========================================
Files 1389 1389
Lines 325167 325396 +229
Branches 10724 10727 +3
==========================================
+ Hits 313232 313450 +218
- Misses 9225 9234 +9
- Partials 2710 2712 +2 |
@CollinAlpert Is there a github issue tracking this bug or was this identified by you through dogfooding? |
@@ -8,6 +9,25 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Analyzers.MetaAnalyzers | |||
<DiagnosticAnalyzer(LanguageNames.VisualBasic)> | |||
Public Class BasicDiagnosticAnalyzerFieldsAnalyzer | |||
Inherits DiagnosticAnalyzerFieldsAnalyzer(Of ClassBlockSyntax, StructureBlockSyntax, FieldDeclarationSyntax, TypeSyntax, SimpleAsClauseSyntax) | |||
|
|||
Protected Overrides Function IsContainedInFuncOrAction(typeSyntax As TypeSyntax, model As SemanticModel, funcs As ImmutableArray(Of INamedTypeSymbol), actions As ImmutableArray(Of INamedTypeSymbol)) As Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add VB tests for this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I simplified the check to use DelegateInvokeMethod
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I can merge once you add VB tests. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR removes the warning for storing per-compilation data inside an analyzer field, when that field is a delegate type.