From cd8cd0ce3a683abd962fccc80a6fbb02e7e6e0d4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 5 Dec 2014 18:13:58 -0800 Subject: [PATCH] Check if the symbol exists before checking its visibility. Should fix #1348. --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5cd71544272..fb361b64cc8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1012,7 +1012,7 @@ module ts { var symbol = resolveName(enclosingDeclaration, (firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); // Verify if the symbol is accessible - return hasVisibleDeclarations(symbol) || { + return (symbol && hasVisibleDeclarations(symbol)) || { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: getTextOfNode(firstIdentifier), errorNode: firstIdentifier