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 {