@@ -28,13 +28,12 @@ async function countEverything(): Promise<number> {
2828    const [resultA, resultB] = await Promise.all([
2929>resultA : A[]
3030>resultB : B[]
31- >await Promise.all([        providerA(),        providerB(),    ] as const ) : [A[], B[]]
32- >Promise.all([        providerA(),        providerB(),    ] as const ) : Promise<[A[], B[]]>
31+ >await Promise.all([        providerA(),        providerB(),    ]) : [A[], B[]]
32+ >Promise.all([        providerA(),        providerB(),    ]) : Promise<[A[], B[]]>
3333>Promise.all : { <TAll>(values: Iterable<TAll>): Promise<(TAll extends undefined ? TAll : TAll extends PromiseLike<infer UAll> ? UAll : TAll)[]>; <T extends readonly any[]>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>; }
3434>Promise : PromiseConstructor
3535>all : { <TAll>(values: Iterable<TAll>): Promise<(TAll extends undefined ? TAll : TAll extends PromiseLike<infer UAll> ? UAll : TAll)[]>; <T extends readonly any[]>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>; }
36- >[        providerA(),        providerB(),    ] as const : readonly [Promise<A[]>, Promise<B[]>]
37- >[        providerA(),        providerB(),    ] : readonly [Promise<A[]>, Promise<B[]>]
36+ >[        providerA(),        providerB(),    ] : [Promise<A[]>, Promise<B[]>]
3837
3938        providerA(),
4039>providerA() : Promise<A[]>
@@ -44,7 +43,7 @@ async function countEverything(): Promise<number> {
4443>providerB() : Promise<B[]>
4544>providerB : () => Promise<B[]>
4645
47-     ] as const );
46+     ]);
4847
4948    const dataA: A[] = resultA;
5049>dataA : A[]
@@ -72,3 +71,14 @@ async function countEverything(): Promise<number> {
7271>0 : 0
7372}
7473
74+ // #31179
75+ 
76+ const expected: Promise<["a", "b", "c"]> = Promise.all(undefined as readonly ["a", "b", "c"]);
77+ >expected : Promise<["a", "b", "c"]>
78+ >Promise.all(undefined as readonly ["a", "b", "c"]) : Promise<["a", "b", "c"]>
79+ >Promise.all : { <TAll>(values: Iterable<TAll>): Promise<(TAll extends undefined ? TAll : TAll extends PromiseLike<infer UAll> ? UAll : TAll)[]>; <T extends readonly any[]>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>; }
80+ >Promise : PromiseConstructor
81+ >all : { <TAll>(values: Iterable<TAll>): Promise<(TAll extends undefined ? TAll : TAll extends PromiseLike<infer UAll> ? UAll : TAll)[]>; <T extends readonly any[]>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>; }
82+ >undefined as readonly ["a", "b", "c"] : readonly ["a", "b", "c"]
83+ >undefined : undefined
84+ 
0 commit comments