Merge pull request #9083 from zhengbli/i6853

Check use before declaration if both the use and decalration are not in module file
This commit is contained in:
Zhengbo Li
2016-06-15 12:43:30 -07:00
committed by GitHub
5 changed files with 29 additions and 2 deletions
+2 -1
View File
@@ -562,7 +562,8 @@ namespace ts {
const declarationFile = getSourceFileOfNode(declaration);
const useFile = getSourceFileOfNode(usage);
if (declarationFile !== useFile) {
if (modulekind || (!compilerOptions.outFile && !compilerOptions.out)) {
if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
(!compilerOptions.outFile && !compilerOptions.out)) {
// nodes are in different files and order cannot be determines
return true;
}