@@ -14,7 +14,7 @@ private void CheckForRedundantThrowsDeclarationsHandledByDeclaredSuperClass(
1414 ImmutableArray < AttributeData > throwsAttributes )
1515 {
1616 var declaredTypes = new HashSet < INamedTypeSymbol > ( SymbolEqualityComparer . Default ) ;
17- var typeToArgMap = new Dictionary < INamedTypeSymbol , ExpressionSyntax > ( SymbolEqualityComparer . Default ) ;
17+ var typeToArgMap = new Dictionary < INamedTypeSymbol , TypeOfExpressionSyntax > ( SymbolEqualityComparer . Default ) ;
1818
1919 foreach ( var attrData in throwsAttributes )
2020 {
@@ -52,7 +52,7 @@ private void CheckForRedundantThrowsDeclarationsHandledByDeclaredSuperClass(
5252 {
5353 context . ReportDiagnostic ( Diagnostic . Create (
5454 RuleDuplicateThrowsByHierarchy ,
55- expression . GetLocation ( ) , // ✅ precise location
55+ expression . Type . GetLocation ( ) , // ✅ precise location
5656 otherType . Name ) ) ;
5757 }
5858 break ;
@@ -79,7 +79,7 @@ private void CheckForRedundantThrowsHandledByDeclaredSuperClass(
7979 {
8080 var semanticModel = context . SemanticModel ;
8181 var declaredTypes = new HashSet < INamedTypeSymbol > ( SymbolEqualityComparer . Default ) ;
82- var typeToExprMap = new Dictionary < INamedTypeSymbol , ExpressionSyntax > ( SymbolEqualityComparer . Default ) ;
82+ var typeToExprMap = new Dictionary < INamedTypeSymbol , TypeOfExpressionSyntax > ( SymbolEqualityComparer . Default ) ;
8383
8484 foreach ( var throwsAttribute in throwsAttributes )
8585 {
@@ -112,7 +112,7 @@ private void CheckForRedundantThrowsHandledByDeclaredSuperClass(
112112 {
113113 context . ReportDiagnostic ( Diagnostic . Create (
114114 RuleDuplicateThrowsByHierarchy ,
115- expr . GetLocation ( ) ,
115+ expr . Type . GetLocation ( ) ,
116116 otherType . Name ) ) ;
117117 }
118118 break ;
0 commit comments