Use reference map from declaration file as exported map to handle deep import semantic diagnostics invalidation

Fixes #27973
This commit is contained in:
Sheetal Nandi
2018-10-18 12:04:14 -07:00
parent e58371e03a
commit d352b8c2c7
2 changed files with 48 additions and 0 deletions

View File

@@ -292,6 +292,11 @@ namespace ts.BuilderState {
let latestSignature: string;
if (sourceFile.isDeclarationFile) {
latestSignature = sourceFile.version;
if (exportedModulesMapCache && latestSignature !== prevSignature) {
// All the references in this file are exported
const references = state.referencedMap ? state.referencedMap.get(sourceFile.path) : undefined;
exportedModulesMapCache.set(sourceFile.path, references || false);
}
}
else {
const emitOutput = getFileEmitOutput(programOfThisState, sourceFile, /*emitOnlyDtsFiles*/ true, cancellationToken);