|
| 1 | +//// [tests/cases/conformance/types/mapped/mappedTypesGenericTuples2.ts] //// |
| 2 | + |
| 3 | +=== mappedTypesGenericTuples2.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/57389 |
| 5 | + |
| 6 | +declare function getT<T>(): T; |
| 7 | +>getT : Symbol(getT, Decl(mappedTypesGenericTuples2.ts, 0, 0)) |
| 8 | +>T : Symbol(T, Decl(mappedTypesGenericTuples2.ts, 2, 22)) |
| 9 | +>T : Symbol(T, Decl(mappedTypesGenericTuples2.ts, 2, 22)) |
| 10 | + |
| 11 | +Promise.all([getT<string>(), ...getT<any>()]).then((result) => { |
| 12 | +>Promise.all([getT<string>(), ...getT<any>()]).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) |
| 13 | +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 14 | +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) |
| 15 | +>all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 16 | +>getT : Symbol(getT, Decl(mappedTypesGenericTuples2.ts, 0, 0)) |
| 17 | +>getT : Symbol(getT, Decl(mappedTypesGenericTuples2.ts, 0, 0)) |
| 18 | +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) |
| 19 | +>result : Symbol(result, Decl(mappedTypesGenericTuples2.ts, 4, 52)) |
| 20 | + |
| 21 | + const head = result[0]; // string |
| 22 | +>head : Symbol(head, Decl(mappedTypesGenericTuples2.ts, 5, 7)) |
| 23 | +>result : Symbol(result, Decl(mappedTypesGenericTuples2.ts, 4, 52)) |
| 24 | +>0 : Symbol(0) |
| 25 | + |
| 26 | + const tail = result.slice(1); // any[] |
| 27 | +>tail : Symbol(tail, Decl(mappedTypesGenericTuples2.ts, 6, 7)) |
| 28 | +>result.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) |
| 29 | +>result : Symbol(result, Decl(mappedTypesGenericTuples2.ts, 4, 52)) |
| 30 | +>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) |
| 31 | + |
| 32 | + tail satisfies string[]; // ok |
| 33 | +>tail : Symbol(tail, Decl(mappedTypesGenericTuples2.ts, 6, 7)) |
| 34 | + |
| 35 | +}); |
| 36 | + |
0 commit comments