Skip to content

Commit 7dd3cde

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 52df34b commit 7dd3cde

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
@@ -732,7 +732,8 @@ namespace ts {
732732
const useFile = getSourceFileOfNode(usage);
733733
if (declarationFile !== useFile) {
734734
if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
735-
(!compilerOptions.outFile && !compilerOptions.out)) {
735+
(!compilerOptions.outFile && !compilerOptions.out) ||
736+
isInAmbientContext(declaration)) {
736737
// nodes are in different files and order cannot be determined
737738
return true;
738739
}

0 commit comments

Comments
 (0)