forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharrayFlatMap.types
25 lines (21 loc) · 1.26 KB
/
arrayFlatMap.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
=== tests/cases/compiler/arrayFlatMap.ts ===
const array: number[] = [];
>array : number[]
>[] : number[]
const readonlyArray: ReadonlyArray<number> = [];
>readonlyArray : readonly number[]
>[] : number[]
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 | readonly U[], thisArg?: This) => U[]
>array : number[]
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
>[] : number[]
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 | readonly U[], thisArg?: This) => U[]
>readonlyArray : readonly number[]
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
>[] : number[]