File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7780,16 +7780,15 @@ namespace ts {
77807780 if (cache[key]) {
77817781 return cache[key];
77827782 }
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- }
77907783 if (!contains(antecedentTypes, type)) {
77917784 antecedentTypes.push(type);
77927785 }
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+ }
77937792 }
77947793 return cache[key] = getUnionType(antecedentTypes);
77957794 }
You can’t perform that action at this time.
0 commit comments