From e388a2642a3c54b1aa36bdfe725129800df95046 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 5 Jan 2021 06:58:13 -1000 Subject: [PATCH] Fix issue with unions not being marked primitive-only --- src/compiler/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3680d49fcff..1daa67bcbe8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5008,7 +5008,7 @@ namespace ts { // This *should* be every type other than null, undefined, void, and never Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive, /* @internal */ - NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | StructuredOrInstantiable, + NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | Object | Intersection | Instantiable, // The following flags are aggregated during union and intersection type construction /* @internal */ IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive | TemplateLiteral,