Skip to content

Commit 5ed39af

Browse files
committed
change in types also makes reused module resolutions from old program
1 parent dcdabff commit 5ed39af

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ namespace ts {
13491349
}
13501350

13511351
if (!arrayIsEqualTo(options.types, oldOptions.types)) {
1352-
return StructureIsReused.Not;
1352+
return StructureIsReused.SafeModules;
13531353
}
13541354

13551355
// check if program source files has changed in the way that can affect structure of the program

src/testRunner/unittests/reuseProgramStructure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ namespace ts {
262262
it("fails if change affects type references", () => {
263263
const program1 = newProgram(files, ["a.ts"], { types: ["a"] });
264264
const program2 = updateProgram(program1, ["a.ts"], { types: ["b"] }, noop);
265-
assert.equal(program2.structureIsReused, StructureIsReused.Not);
265+
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
266266
});
267267

268268
it("succeeds if change doesn't affect type references", () => {

0 commit comments

Comments
 (0)