=== tests/cases/conformance/types/mapped/mappedTypesArraysTuples.ts === type Box = { value: T }; >Box : Box >value : T type Boxified = { [P in keyof T]: Box }; >Boxified : Boxified type T00 = Boxified<[number, string?, ...boolean[]]>; >T00 : [Box, Box?, ...Box[]] type T01 = Partial<[number, string?, ...boolean[]]>; >T01 : [(number | undefined)?, (string | undefined)?, ...(boolean | undefined)[]] type T02 = Required<[number, string?, ...boolean[]]>; >T02 : [number, string, ...boolean[]] type T10 = Boxified; >T10 : Box[] type T11 = Partial; >T11 : (string | undefined)[] type T12 = Required; >T12 : string[] type T13 = Boxified>; >T13 : readonly Box[] type T14 = Partial>; >T14 : readonly (string | undefined)[] type T15 = Required>; >T15 : readonly string[] type T20 = Boxified<(string | undefined)[]>; >T20 : Box[] type T21 = Partial<(string | undefined)[]>; >T21 : (string | undefined)[] type T22 = Required<(string | undefined)[]>; >T22 : string[] type T23 = Boxified>; >T23 : readonly Box[] type T24 = Partial>; >T24 : readonly (string | undefined)[] type T25 = Required>; >T25 : readonly string[] type T30 = Boxified>; >T30 : Box[] type T31 = Partial>; >T31 : (Box | undefined)[] type A = { a: string }; >A : A >a : string type B = { b: string }; >B : B >b : string type T40 = Boxified | [A, B] | string | string[]>; >T40 : T40 type ReadWrite = { -readonly [P in keyof T] : T[P] }; >ReadWrite : ReadWrite type T50 = Readonly; >T50 : readonly string[] type T51 = Readonly<[number, number]>; >T51 : readonly [number, number] type T52 = Partial>; >T52 : readonly (string | undefined)[] type T53 = Readonly>; >T53 : readonly (string | undefined)[] type T54 = ReadWrite>; >T54 : string[] declare function unboxify(x: Boxified): T; >unboxify : (x: Boxified) => T >x : Boxified declare let x10: [Box, Box, ...Box[]]; >x10 : [Box, Box, ...Box[]] let y10 = unboxify(x10); >y10 : [number, string, ...boolean[]] >unboxify(x10) : [number, string, ...boolean[]] >unboxify : (x: Boxified) => T >x10 : [Box, Box, ...Box[]] declare let x11: Box[]; >x11 : Box[] let y11 = unboxify(x11); >y11 : number[] >unboxify(x11) : number[] >unboxify : (x: Boxified) => T >x11 : Box[] declare let x12: { a: Box, b: Box }; >x12 : { a: Box; b: Box; } >a : Box >b : Box let y12 = unboxify(x12); >y12 : { a: number; b: string[]; } >unboxify(x12) : { a: number; b: string[]; } >unboxify : (x: Boxified) => T >x12 : { a: Box; b: Box; } declare function nonpartial(x: Partial): T; >nonpartial : (x: Partial) => T >x : Partial declare let x20: [number | undefined, string?, ...boolean[]]; >x20 : [number | undefined, (string | undefined)?, ...boolean[]] let y20 = nonpartial(x20); >y20 : [number, string, ...boolean[]] >nonpartial(x20) : [number, string, ...boolean[]] >nonpartial : (x: Partial) => T >x20 : [number | undefined, (string | undefined)?, ...boolean[]] declare let x21: (number | undefined)[]; >x21 : (number | undefined)[] let y21 = nonpartial(x21); >y21 : number[] >nonpartial(x21) : number[] >nonpartial : (x: Partial) => T >x21 : (number | undefined)[] declare let x22: { a: number | undefined, b?: string[] }; >x22 : { a: number | undefined; b?: string[] | undefined; } >a : number | undefined >b : string[] | undefined let y22 = nonpartial(x22); >y22 : { a: number; b: string[]; } >nonpartial(x22) : { a: number; b: string[]; } >nonpartial : (x: Partial) => T >x22 : { a: number | undefined; b?: string[] | undefined; } type __Awaited = T extends PromiseLike ? U : T; >__Awaited : __Awaited type Awaitified = { [P in keyof T]: __Awaited }; >Awaitified : Awaitified declare function all(...values: T): Promise>; >all : (...values: T) => Promise> >values : T function f1(a: number, b: Promise, c: string[], d: Promise) { >f1 : (a: number, b: Promise, c: string[], d: Promise) => void >a : number >b : Promise >c : string[] >d : Promise let x1 = all(a); >x1 : Promise<[number]> >all(a) : Promise<[number]> >all : (...values: T) => Promise> >a : number let x2 = all(a, b); >x2 : Promise<[number, number]> >all(a, b) : Promise<[number, number]> >all : (...values: T) => Promise> >a : number >b : Promise let x3 = all(a, b, c); >x3 : Promise<[number, number, string[]]> >all(a, b, c) : Promise<[number, number, string[]]> >all : (...values: T) => Promise> >a : number >b : Promise >c : string[] let x4 = all(a, b, c, d); >x4 : Promise<[number, number, string[], string[]]> >all(a, b, c, d) : Promise<[number, number, string[], string[]]> >all : (...values: T) => Promise> >a : number >b : Promise >c : string[] >d : Promise } function f2(a: Boxified) { >f2 : (a: Boxified) => void >a : Boxified let x: Box | undefined = a.pop(); >x : Box | undefined >a.pop() : Box | undefined >a.pop : () => Box | undefined >a : Boxified >pop : () => Box | undefined let y: Box[] = a.concat(a); >y : Box[] >a.concat(a) : Box[] >a.concat : { (...items: ConcatArray>[]): Box[]; (...items: (Box | ConcatArray>)[]): Box[]; } >a : Boxified >concat : { (...items: ConcatArray>[]): Box[]; (...items: (Box | ConcatArray>)[]): Box[]; } >a : Boxified } // Repro from #26163 type ElementType = T extends Array ? U : never; >ElementType : ElementType type Mapped = { [K in keyof T]: T[K] }; >Mapped : Mapped type F = ElementType>; >F : F type R1 = F<[string, number, boolean]>; // string | number | boolean >R1 : string | number | boolean type R2 = ElementType>; // string | number | boolean >R2 : string | number | boolean // Repro from #26163 declare function acceptArray(arr: any[]): void; >acceptArray : (arr: any[]) => void >arr : any[] declare function mapArray(arr: T): Mapped; >mapArray : (arr: T) => Mapped >arr : T function acceptMappedArray(arr: T) { >acceptMappedArray : (arr: T) => void >arr : T acceptArray(mapArray(arr)); >acceptArray(mapArray(arr)) : void >acceptArray : (arr: any[]) => void >mapArray(arr) : Mapped >mapArray : (arr: T) => Mapped >arr : T } // Repro from #26163 type Unconstrained = ElementType>; >Unconstrained : Unconstrained type T1 = Unconstrained<[string, number, boolean]>; // string | number | boolean >T1 : string | number | boolean type Constrained = ElementType>; >Constrained : Constrained type T2 = Constrained<[string, number, boolean]>; // string | number | boolean >T2 : string | number | boolean