From d45806a9844d7495c0cc25e70aff637cbf9b16fd Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 23 May 2021 17:03:11 -0700 Subject: [PATCH] More closely match previous behavior --- 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 d64d1e5da3b..ff3ec78a931 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -24122,7 +24122,7 @@ namespace ts { } function isGenericTypeWithUnionConstraint(type: Type) { - return !!(type.flags & TypeFlags.Instantiable && getBaseConstraintOrType(type).flags & TypeFlags.Union); + return !!(type.flags & TypeFlags.Instantiable && getBaseConstraintOrType(type).flags & (TypeFlags.Nullable | TypeFlags.Union)); } function containsGenericType(type: Type): boolean {