File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -7780,16 +7780,15 @@ namespace ts {
7780
7780
if (cache[key]) {
7781
7781
return cache[key];
7782
7782
}
7783
- // If the type at a particular antecedent path is the declared type and the
7784
- // reference is known to always be assigned (i.e. when declared and initial types
7785
- // are the same), there is no reason to process more antecedents since the only
7786
- // possible outcome is subtypes that will be removed in the final union type anyway.
7787
- if (type === declaredType && declaredType === initialType) {
7788
- return cache[key] = type;
7789
- }
7790
7783
if (!contains(antecedentTypes, type)) {
7791
7784
antecedentTypes.push(type);
7792
7785
}
7786
+ // If the type at a particular antecedent path is the declared type there is no
7787
+ // reason to process more antecedents since the only possible outcome is subtypes
7788
+ // that will be removed in the final union type anyway.
7789
+ if (type === declaredType) {
7790
+ break;
7791
+ }
7793
7792
}
7794
7793
return cache[key] = getUnionType(antecedentTypes);
7795
7794
}
You can’t perform that action at this time.
0 commit comments