From 6499302983abccc892c158e2d67ee2ba9ac97b78 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 25 Oct 2021 17:48:35 -0700 Subject: [PATCH] Always cache union and intersection relations --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ed75651e6e..32b3f3e09c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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); }