Always use thisType when generating tuple id

This commit is contained in:
Nathan Shively-Sanders 2016-08-09 15:37:15 -07:00
parent 6a8f4cb676
commit 80963baf50

View file

@ -1538,8 +1538,8 @@ namespace ts {
function createType(flags: TypeFlags): Type {
const result = new Type(checker, flags);
result.id = typeCount;
typeCount++;
result.id = typeCount;
return result;
}
@ -5235,11 +5235,7 @@ namespace ts {
}
function createTupleType(elementTypes: Type[], thisType?: Type) {
let id = getTypeListId(elementTypes);
if (thisType) {
id += ',' + thisType.id;
}
const id = getTypeListId(elementTypes) + ',' + (thisType ? thisType.id : 0);
return tupleTypes[id] || (tupleTypes[id] = createNewTupleType(elementTypes, thisType));
}