|
| 1 | +=== tests/cases/compiler/mappedTypeNestedGenericInstantiation.ts === |
| 2 | +// Repro from #13346 |
| 3 | + |
| 4 | +interface Chainable<T> { |
| 5 | +>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0)) |
| 6 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20)) |
| 7 | + |
| 8 | + value(): T; |
| 9 | +>value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24)) |
| 10 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20)) |
| 11 | + |
| 12 | + mapValues<U>(func: (v: T[keyof T]) => U): Chainable<{[k in keyof T]: U}>; |
| 13 | +>mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13)) |
| 14 | +>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12)) |
| 15 | +>func : Symbol(func, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 15)) |
| 16 | +>v : Symbol(v, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 22)) |
| 17 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20)) |
| 18 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20)) |
| 19 | +>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12)) |
| 20 | +>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0)) |
| 21 | +>k : Symbol(k, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 56)) |
| 22 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20)) |
| 23 | +>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12)) |
| 24 | +} |
| 25 | + |
| 26 | +declare function chain<T>(t: T): Chainable<T>; |
| 27 | +>chain : Symbol(chain, Decl(mappedTypeNestedGenericInstantiation.ts, 5, 1)) |
| 28 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23)) |
| 29 | +>t : Symbol(t, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 26)) |
| 30 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23)) |
| 31 | +>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0)) |
| 32 | +>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23)) |
| 33 | + |
| 34 | +const square = (x: number) => x * x; |
| 35 | +>square : Symbol(square, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 5)) |
| 36 | +>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16)) |
| 37 | +>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16)) |
| 38 | +>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16)) |
| 39 | + |
| 40 | +const v = chain({a: 1, b: 2}).mapValues(square).value(); |
| 41 | +>v : Symbol(v, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 5)) |
| 42 | +>chain({a: 1, b: 2}).mapValues(square).value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24)) |
| 43 | +>chain({a: 1, b: 2}).mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13)) |
| 44 | +>chain : Symbol(chain, Decl(mappedTypeNestedGenericInstantiation.ts, 5, 1)) |
| 45 | +>a : Symbol(a, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 17)) |
| 46 | +>b : Symbol(b, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 22)) |
| 47 | +>mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13)) |
| 48 | +>square : Symbol(square, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 5)) |
| 49 | +>value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24)) |
| 50 | + |
0 commit comments