73 lines
1.2 KiB
Text
73 lines
1.2 KiB
Text
=== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments.ts ===
|
|
function f<T, U>(y: T, f: (x: T) => U, x: T): [T, U] { return [y, f(x)]; }
|
|
>f : <T, U>(y: T, f: (x: T) => U, x: T) => [T, U]
|
|
>T : T
|
|
>U : U
|
|
>y : T
|
|
>T : T
|
|
>f : (x: T) => U
|
|
>x : T
|
|
>T : T
|
|
>U : U
|
|
>x : T
|
|
>T : T
|
|
>T : T
|
|
>U : U
|
|
>[y, f(x)] : [T, U]
|
|
>y : T
|
|
>f(x) : U
|
|
>f : (x: T) => U
|
|
>x : T
|
|
|
|
interface A { a: A; }
|
|
>A : A
|
|
>a : A
|
|
>A : A
|
|
|
|
interface B extends A { b; }
|
|
>B : B
|
|
>A : A
|
|
>b : any
|
|
|
|
var a: A, b: B;
|
|
>a : A
|
|
>A : A
|
|
>b : B
|
|
>B : B
|
|
|
|
var d = f(b, x => x.a, a); // type [A, A]
|
|
>d : [A, A]
|
|
>f(b, x => x.a, a) : [A, A]
|
|
>f : <T, U>(y: T, f: (x: T) => U, x: T) => [T, U]
|
|
>b : B
|
|
>x => x.a : (x: A) => A
|
|
>x : A
|
|
>x.a : A
|
|
>x : A
|
|
>a : A
|
|
>a : A
|
|
|
|
var d2 = f(b, x => x.a, null); // type [B, A]
|
|
>d2 : [B, A]
|
|
>f(b, x => x.a, null) : [B, A]
|
|
>f : <T, U>(y: T, f: (x: T) => U, x: T) => [T, U]
|
|
>b : B
|
|
>x => x.a : (x: B) => A
|
|
>x : B
|
|
>x.a : A
|
|
>x : B
|
|
>a : A
|
|
>null : null
|
|
|
|
var d3 = f(b, x => x.b, null); // type [B, any]
|
|
>d3 : [B, any]
|
|
>f(b, x => x.b, null) : [B, any]
|
|
>f : <T, U>(y: T, f: (x: T) => U, x: T) => [T, U]
|
|
>b : B
|
|
>x => x.b : (x: B) => any
|
|
>x : B
|
|
>x.b : any
|
|
>x : B
|
|
>b : any
|
|
>null : null
|
|
|