Skip to content

Commit 8993877

Browse files
classify nonPrimitive type as narrowable rather than structured
1 parent 66069fc commit 8993877

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,13 +2799,13 @@ namespace ts {
27992799
BooleanLike = Boolean | BooleanLiteral,
28002800
EnumLike = Enum | EnumLiteral,
28012801
UnionOrIntersection = Union | Intersection,
2802-
StructuredType = Object | Union | Intersection | NonPrimitive,
2802+
StructuredType = Object | Union | Intersection,
28032803
StructuredOrTypeParameter = StructuredType | TypeParameter | Index,
28042804
TypeVariable = TypeParameter | IndexedAccess,
28052805

28062806
// 'Narrowable' types are types where narrowing actually narrows.
28072807
// This *should* be every type other than null, undefined, void, and never
2808-
Narrowable = Any | StructuredType | TypeParameter | Index | IndexedAccess | StringLike | NumberLike | BooleanLike | ESSymbol,
2808+
Narrowable = Any | StructuredType | TypeParameter | Index | IndexedAccess | StringLike | NumberLike | BooleanLike | ESSymbol | NonPrimitive,
28092809
NotUnionOrUnit = Any | ESSymbol | Object | NonPrimitive,
28102810
/* @internal */
28112811
RequiresWidening = ContainsWideningType | ContainsObjectLiteral,

0 commit comments

Comments
 (0)