File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11066,8 +11066,14 @@ namespace ts {
11066
11066
if (!links.switchTypes) {
11067
11067
// If all case clauses specify expressions that have unit types, we return an array
11068
11068
// of those unit types. Otherwise we return an empty array.
11069
- const types = map(switchStatement.caseBlock.clauses, getTypeOfSwitchClause);
11070
- links.switchTypes = !contains(types, undefined) ? types : emptyArray;
11069
+ links.switchTypes = [];
11070
+ for (const clause of switchStatement.caseBlock.clauses) {
11071
+ const type = getTypeOfSwitchClause(clause);
11072
+ if (type === undefined) {
11073
+ return links.switchTypes = emptyArray;
11074
+ }
11075
+ links.switchTypes.push(type);
11076
+ }
11071
11077
}
11072
11078
return links.switchTypes;
11073
11079
}
You can’t perform that action at this time.
0 commit comments