Skip to content

Commit b6f1225

Browse files
Merge pull request #1399 from Microsoft/checkSymbolExists
Check if the symbol exists before checking its visibility in isEntityNameVisible.
2 parents 44eca09 + cd8cd0c commit b6f1225

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ module ts {
10121012
var symbol = resolveName(enclosingDeclaration, (<Identifier>firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined);
10131013

10141014
// Verify if the symbol is accessible
1015-
return hasVisibleDeclarations(symbol) || <SymbolVisibilityResult>{
1015+
return (symbol && hasVisibleDeclarations(symbol)) || <SymbolVisibilityResult>{
10161016
accessibility: SymbolAccessibility.NotAccessible,
10171017
errorSymbolName: getTextOfNode(firstIdentifier),
10181018
errorNode: firstIdentifier

0 commit comments

Comments
 (0)