From 239dde8ff1306170f6d120dc32bb235661e22909 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 30 May 2018 13:37:32 -0700 Subject: [PATCH] Fix cast: location may be a SourceFile (#24498) --- 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 e6ca0e07756..647384c5a30 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1291,7 +1291,7 @@ namespace ts { isInExternalModule = true; // falls through case SyntaxKind.ModuleDeclaration: - const moduleExports = getSymbolOfNode(location as ModuleDeclaration).exports!; + const moduleExports = getSymbolOfNode(location as SourceFile | ModuleDeclaration).exports!; if (location.kind === SyntaxKind.SourceFile || isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local