From e76c96ce547e670789da978cdcb64e7c72c6cb27 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 11 May 2017 11:37:28 -0700 Subject: [PATCH] Allow references to ambient block scoped variables Even when 1. --out or --outfile is specified 2. The block scoped variable's file is after the referrer's file. --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 861279b2225..82c3eaaf04b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -737,7 +737,8 @@ namespace ts { const useFile = getSourceFileOfNode(usage); if (declarationFile !== useFile) { if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || - (!compilerOptions.outFile && !compilerOptions.out)) { + (!compilerOptions.outFile && !compilerOptions.out) || + isInAmbientContext(declaration)) { // nodes are in different files and order cannot be determined return true; }