Skip to content

Commit 80963ba

Browse files
committed
Always use thisType when generating tuple id
1 parent 6a8f4cb commit 80963ba

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,8 +1538,8 @@ namespace ts {
15381538

15391539
function createType(flags: TypeFlags): Type {
15401540
const result = new Type(checker, flags);
1541-
result.id = typeCount;
15421541
typeCount++;
1542+
result.id = typeCount;
15431543
return result;
15441544
}
15451545

@@ -5235,11 +5235,7 @@ namespace ts {
52355235
}
52365236

52375237
function createTupleType(elementTypes: Type[], thisType?: Type) {
5238-
let id = getTypeListId(elementTypes);
5239-
if (thisType) {
5240-
id += ',' + thisType.id;
5241-
}
5242-
5238+
const id = getTypeListId(elementTypes) + ',' + (thisType ? thisType.id : 0);
52435239
return tupleTypes[id] || (tupleTypes[id] = createNewTupleType(elementTypes, thisType));
52445240
}
52455241

0 commit comments

Comments
 (0)