Skip to content

Commit edc497b

Browse files
authored
Find method references through base abstract classes implementing an interface (#61234)
1 parent b95187d commit edc497b

File tree

3 files changed

+529
-2
lines changed

3 files changed

+529
-2
lines changed

src/services/findAllReferences.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,9 +2679,10 @@ export namespace Core {
26792679
return firstDefined(symbol.declarations, declaration =>
26802680
firstDefined(getAllSuperTypeNodes(declaration), typeReference => {
26812681
const type = checker.getTypeAtLocation(typeReference);
2682-
const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
2682+
const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName);
26832683
// Visit the typeReference as well to see if it directly or indirectly uses that property
2684-
return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
2684+
// When `propertySymbol` is missing continue the recursion through parents as some parent up the chain might be an abstract class that implements interface having the property
2685+
return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol);
26852686
}));
26862687
}
26872688
}

0 commit comments

Comments
 (0)