f494742ce9
* Added/updated tests.
* Accepted baselines.
* Update test.
* Update instantiateMappedType to work specially when 'any' replaced an array.
* Accepted baselines.
* Ensure check works when constraint is a union of arrayish types, just like in `Promise.all`.
* Accepted baselines.
* Update test for indirect instantiation of a mapped type.
* Accepted baselines.
* Update test comment.
* Accepted baselines.
* Added tuple test case.
* Accepted baselines.
* Don't add special behavior for tuples.
* Accepted baselines.
* Revert "Don't add special behavior for tuples."
This reverts commit f01ae16e65
.
* Accepted baselines.
22 lines
622 B
Plaintext
22 lines
622 B
Plaintext
=== tests/cases/compiler/promiseAllOnAny01.ts ===
|
|
async function foo(x: any) {
|
|
>foo : (x: any) => Promise<any[]>
|
|
>x : any
|
|
|
|
let abc = await Promise.all(x);
|
|
>abc : any[]
|
|
>await Promise.all(x) : any[]
|
|
>Promise.all(x) : Promise<any[]>
|
|
>Promise.all : <T extends readonly unknown[] | []>(values: T) => Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>
|
|
>Promise : PromiseConstructor
|
|
>all : <T extends readonly unknown[] | []>(values: T) => Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>
|
|
>x : any
|
|
|
|
let result: any[] = abc;
|
|
>result : any[]
|
|
>abc : any[]
|
|
|
|
return result;
|
|
>result : any[]
|
|
}
|