Skip to content

Commit cd8cd0c

Browse files
Check if the symbol exists before checking its visibility.
Should fix #1348.
1 parent a4ab192 commit cd8cd0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: 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)