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