Skip to content

Commit 4673b57

Browse files
Merge pull request #6507 from JKillian/fix-prop-bug
Fix issue #6478 (bug in the language services)
2 parents a24900e + 047c62c commit 4673b57

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/services/services.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6028,6 +6028,10 @@ namespace ts {
60286028
*/
60296029
function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[],
60306030
previousIterationSymbolsCache: SymbolTable): void {
6031+
if (!symbol) {
6032+
return;
6033+
}
6034+
60316035
// If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited
60326036
// This is particularly important for the following cases, so that we do not infinitely visit the same symbol.
60336037
// For example:
@@ -6043,7 +6047,7 @@ namespace ts {
60436047
return;
60446048
}
60456049

6046-
if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
6050+
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
60476051
forEach(symbol.getDeclarations(), declaration => {
60486052
if (declaration.kind === SyntaxKind.ClassDeclaration) {
60496053
getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(<ClassDeclaration>declaration));
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
// @Filename: file1.ts
4+
//// class ClassA implements IInterface {
5+
//// private /*1*/value: number;
6+
//// }
7+
8+
goTo.marker("1");
9+
verify.documentHighlightsAtPositionCount(1, ["file1.ts"]);

0 commit comments

Comments
 (0)