Skip to content

Commit ec18bd0

Browse files
committed
Removing stack from removeSubtypes method
1 parent a8732d7 commit ec18bd0

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3567,28 +3567,14 @@ module ts {
35673567
return false;
35683568
}
35693569

3570-
// Since removeSubtypes checks the subtype relation, and the subtype relation on a union
3571-
// may attempt to reduce a union, it is possible that removeSubtypes could be called
3572-
// recursively on the same set of types. The removeSubtypesStack is used to track which
3573-
// sets of types are currently undergoing subtype reduction.
3574-
let removeSubtypesStack: string[] = [];
35753570
function removeSubtypes(types: Type[]) {
3576-
let typeListId = getTypeListId(types);
3577-
if (removeSubtypesStack.lastIndexOf(typeListId) >= 0) {
3578-
return;
3579-
}
3580-
3581-
removeSubtypesStack.push(typeListId);
3582-
35833571
let i = types.length;
35843572
while (i > 0) {
35853573
i--;
35863574
if (isSubtypeOfAny(types[i], types)) {
35873575
types.splice(i, 1);
35883576
}
35893577
}
3590-
3591-
removeSubtypesStack.pop();
35923578
}
35933579

35943580
function containsAnyType(types: Type[]) {

0 commit comments

Comments
 (0)