26 lines
1.3 KiB
Text
26 lines
1.3 KiB
Text
|
=== tests/cases/compiler/arrayFlatMap.ts ===
|
||
|
const array: number[] = [];
|
||
|
>array : number[]
|
||
|
>[] : undefined[]
|
||
|
|
||
|
const readonlyArray: ReadonlyArray<number> = [];
|
||
|
>readonlyArray : ReadonlyArray<number>
|
||
|
>[] : undefined[]
|
||
|
|
||
|
array.flatMap((): ReadonlyArray<number> => []); // ok
|
||
|
>array.flatMap((): ReadonlyArray<number> => []) : number[]
|
||
|
>array.flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | ReadonlyArray<U>, thisArg?: This) => U[]
|
||
|
>array : number[]
|
||
|
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | ReadonlyArray<U>, thisArg?: This) => U[]
|
||
|
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
|
||
|
>[] : undefined[]
|
||
|
|
||
|
readonlyArray.flatMap((): ReadonlyArray<number> => []); // ok
|
||
|
>readonlyArray.flatMap((): ReadonlyArray<number> => []) : number[]
|
||
|
>readonlyArray.flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | ReadonlyArray<U>, thisArg?: This) => U[]
|
||
|
>readonlyArray : ReadonlyArray<number>
|
||
|
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | ReadonlyArray<U>, thisArg?: This) => U[]
|
||
|
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
|
||
|
>[] : undefined[]
|
||
|
|