Merge pull request #6507 from JKillian/fix-prop-bug

Fix issue #6478 (bug in the language services)
This commit is contained in:
Daniel Rosenwasser 2016-01-15 18:50:14 -08:00
commit 4673b57163
2 changed files with 14 additions and 1 deletions

View File

@ -6028,6 +6028,10 @@ namespace ts {
*/
function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[],
previousIterationSymbolsCache: SymbolTable): void {
if (!symbol) {
return;
}
// If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited
// This is particularly important for the following cases, so that we do not infinitely visit the same symbol.
// For example:
@ -6043,7 +6047,7 @@ namespace ts {
return;
}
if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
forEach(symbol.getDeclarations(), declaration => {
if (declaration.kind === SyntaxKind.ClassDeclaration) {
getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(<ClassDeclaration>declaration));

View File

@ -0,0 +1,9 @@
/// <reference path='fourslash.ts'/>
// @Filename: file1.ts
//// class ClassA implements IInterface {
//// private /*1*/value: number;
//// }
goTo.marker("1");
verify.documentHighlightsAtPositionCount(1, ["file1.ts"]);