From b9f805f2f44a4ae94f8215d63df52abd827a9c2f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 13 Apr 2019 08:15:28 -1000 Subject: [PATCH] Remove incorrect optimization in getUnionConstraintOfIntersection --- src/compiler/checker.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7becc4a2f78..72e85b3f8a8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7598,11 +7598,6 @@ namespace ts { constraint = getConstraintOfType(constraint); } if (constraint) { - // A constraint that isn't a union type implies that the final type would be a non-union - // type as well. Since non-union constraints are of no interest, we can exit here. - if (!(constraint.flags & TypeFlags.Union)) { - return undefined; - } constraints = append(constraints, constraint); } }