Skip to content

Commit e76c96c

Browse files
committed
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.
1 parent 066bb16 commit e76c96c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ namespace ts {
737737
const useFile = getSourceFileOfNode(usage);
738738
if (declarationFile !== useFile) {
739739
if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
740-
(!compilerOptions.outFile && !compilerOptions.out)) {
740+
(!compilerOptions.outFile && !compilerOptions.out) ||
741+
isInAmbientContext(declaration)) {
741742
// nodes are in different files and order cannot be determined
742743
return true;
743744
}

0 commit comments

Comments
 (0)