Always cache union and intersection relations

This commit is contained in:
Anders Hejlsberg 2021-10-25 17:48:35 -07:00
parent 8c278bf5ab
commit 6499302983

View file

@ -18207,7 +18207,7 @@ namespace ts {
let result = Ternary.False;
const saveErrorInfo = captureErrorCalculationState();
if ((source.flags & TypeFlags.Union || target.flags & TypeFlags.Union) && getConstituentCount(source) * getConstituentCount(target) < 4) {
if ((source.flags & TypeFlags.Union || target.flags & TypeFlags.Union) && getConstituentCount(source) * getConstituentCount(target) < 0) {
// We skip caching when source or target is a union with no more than three constituents.
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | IntersectionState.UnionIntersectionCheck);
}