When old program resolved to module and that file is included, dont consider as ambient resolution.

Fixes #30422
This commit is contained in:
Sheetal Nandi
2019-04-03 14:05:49 -07:00
parent 5869662c3f
commit 7ccd86bf52
3 changed files with 88 additions and 1 deletions

View File

@@ -1134,7 +1134,7 @@ namespace ts {
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName: string): boolean {
const resolutionToFile = getResolvedModule(oldSourceFile!, moduleName);
const resolvedFile = resolutionToFile && oldProgram!.getSourceFile(resolutionToFile.resolvedFileName);
if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) {
if (resolutionToFile && resolvedFile) {
// In the old program, we resolved to an ambient module that was in the same
// place as we expected to find an actual module file.
// We actually need to return 'false' here even though this seems like a 'true' case