@@ -6320,42 +6320,49 @@ export interface SerializedTypeEntry {
63206320 trackedSymbols : readonly TrackedSymbol [ ] | undefined ;
63216321}
63226322
6323+ // Note that for types of different kinds, the numeric values of TypeFlags determine the order
6324+ // computed by the CompareTypes function and therefore the order of constituent types in union types.
6325+ // Since union type processing often bails out early when a result is known, it is important to order
6326+ // TypeFlags in increasing order of potential type complexity. In particular, indexed access and
6327+ // conditional types should sort last as those types are potentially recursive and possibly infinite.
6328+
63236329// dprint-ignore
63246330export const enum TypeFlags {
63256331 Any = 1 << 0 ,
63266332 Unknown = 1 << 1 ,
6327- String = 1 << 2 ,
6328- Number = 1 << 3 ,
6329- Boolean = 1 << 4 ,
6330- Enum = 1 << 5 , // Numeric computed enum member value
6331- BigInt = 1 << 6 ,
6332- StringLiteral = 1 << 7 ,
6333- NumberLiteral = 1 << 8 ,
6334- BooleanLiteral = 1 << 9 ,
6335- EnumLiteral = 1 << 10 , // Always combined with StringLiteral, NumberLiteral, or Union
6336- BigIntLiteral = 1 << 11 ,
6337- ESSymbol = 1 << 12 , // Type of symbol primitive introduced in ES6
6338- UniqueESSymbol = 1 << 13 , // unique symbol
6339- Void = 1 << 14 ,
6340- Undefined = 1 << 15 ,
6341- Null = 1 << 16 ,
6342- Never = 1 << 17 , // Never type
6343- TypeParameter = 1 << 18 , // Type parameter
6344- Object = 1 << 19 , // Object type
6345- Union = 1 << 20 , // Union (T | U)
6346- Intersection = 1 << 21 , // Intersection (T & U)
6347- Index = 1 << 22 , // keyof T
6348- IndexedAccess = 1 << 23 , // T[K]
6349- Conditional = 1 << 24 , // T extends U ? X : Y
6350- Substitution = 1 << 25 , // Type parameter substitution
6351- NonPrimitive = 1 << 26 , // intrinsic object type
6352- TemplateLiteral = 1 << 27 , // Template literal type
6353- StringMapping = 1 << 28 , // Uppercase/Lowercase type
6333+ Undefined = 1 << 2 ,
6334+ Null = 1 << 3 ,
6335+ Void = 1 << 4 ,
6336+ String = 1 << 5 ,
6337+ Number = 1 << 6 ,
6338+ BigInt = 1 << 7 ,
6339+ Boolean = 1 << 8 ,
6340+ ESSymbol = 1 << 9 , // Type of symbol primitive introduced in ES6
6341+ StringLiteral = 1 << 10 ,
6342+ NumberLiteral = 1 << 11 ,
6343+ BigIntLiteral = 1 << 12 ,
6344+ BooleanLiteral = 1 << 13 ,
6345+ UniqueESSymbol = 1 << 14 , // unique symbol
6346+ EnumLiteral = 1 << 15 , // Always combined with StringLiteral, NumberLiteral, or Union
6347+ Enum = 1 << 16 , // Numeric computed enum member value (must be right after EnumLiteral, see getSortOrderFlags)
6348+ NonPrimitive = 1 << 17 , // intrinsic object type
6349+ Never = 1 << 18 , // Never type
6350+ TypeParameter = 1 << 19 , // Type parameter
6351+ Object = 1 << 20 , // Object type
6352+ Index = 1 << 21 , // keyof T
6353+ TemplateLiteral = 1 << 22 , // Template literal type
6354+ StringMapping = 1 << 23 , // Uppercase/Lowercase type
6355+ Substitution = 1 << 24 , // Type parameter substitution
6356+ IndexedAccess = 1 << 25 , // T[K]
6357+ Conditional = 1 << 26 , // T extends U ? X : Y
6358+ Union = 1 << 27 , // Union (T | U)
6359+ Intersection = 1 << 28 , // Intersection (T & U)
63546360 /** @internal */
63556361 Reserved1 = 1 << 29 , // Used by union/intersection type construction
63566362 /** @internal */
63576363 Reserved2 = 1 << 30 , // Used by union/intersection type construction
6358-
6364+ /** @internal */
6365+ Reserved3 = 1 << 31 ,
63596366 /** @internal */
63606367 AnyOrUnknown = Any | Unknown ,
63616368 /** @internal */
@@ -6539,14 +6546,16 @@ export const enum ObjectFlags {
65396546 PropagatingFlags = ContainsWideningType | ContainsObjectOrArrayLiteral | NonInferrableType ,
65406547 /** @internal */
65416548 InstantiatedMapped = Mapped | Instantiated ,
6542- // Object flags that uniquely identify the kind of ObjectType
6543- /** @internal */
6544- ObjectTypeKindMask = ClassOrInterface | Reference | Tuple | Anonymous | Mapped | ReverseMapped | EvolvingArray ,
6545-
6549+
65466550 // Flags that require TypeFlags.Object
65476551 ContainsSpread = 1 << 21 , // Object literal contains spread operation
65486552 ObjectRestType = 1 << 22 , // Originates in object rest declaration
65496553 InstantiationExpressionType = 1 << 23 , // Originates in instantiation expression
6554+
6555+ // Object flags that uniquely identify the kind of ObjectType
6556+ /** @internal */
6557+ ObjectTypeKindMask = ClassOrInterface | Reference | Tuple | Anonymous | Mapped | ReverseMapped | EvolvingArray | InstantiationExpressionType | SingleSignatureType ,
6558+
65506559 /** @internal */
65516560 IsClassInstanceClone = 1 << 24 , // Type is a clone of a class instance type
65526561 // Flags that require TypeFlags.Object and ObjectFlags.Reference
@@ -7533,6 +7542,8 @@ export interface CompilerOptions {
75337542 strictNullChecks ?: boolean ; // Always combine with strict property
75347543 strictPropertyInitialization ?: boolean ; // Always combine with strict property
75357544 strictBuiltinIteratorReturn ?: boolean ; // Always combine with strict property
7545+ /** @internal */
7546+ stableTypeOrdering ?: boolean ;
75367547 stripInternal ?: boolean ;
75377548 /** @deprecated */
75387549 suppressExcessPropertyErrors ?: boolean ;
@@ -7751,6 +7762,7 @@ export interface CommandLineOptionBase {
77517762 isTSConfigOnly ?: boolean ; // True if option can only be specified via tsconfig.json file
77527763 isCommandLineOnly ?: boolean ;
77537764 showInSimplifiedHelpView ?: boolean ;
7765+ showInHelp ?: boolean ;
77547766 category ?: DiagnosticMessage ;
77557767 strictFlag ?: true ; // true if the option is one of the flag under strict
77567768 allowJsFlag ?: true ;
0 commit comments