=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints.ts === // Generic call with constraints infering type parameter from object member properties // No errors expected class C { >C : C, Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) x: string; >x : string, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 3, 9)) } class D { >D : D, Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) x: string; >x : string, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 7, 9)) y: string; >y : string, Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 8, 14)) } class X { >X : X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) x: T; >x : T, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 12)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) } function foo(t: X, t2: X) { >foo : (t: X, t2: X) => T, Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) >x : string, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 24)) >t : X, Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 38)) >X : X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) >t2 : X, Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 46)) >X : X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) var x: T; >x : T, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) return x; >x : T, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) } var c1 = new X(); >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) >new X() : X >X : typeof X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >C : C, Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) var d1 = new X(); >d1 : X, Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) >new X() : X >X : typeof X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >D : D, Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) var r = foo(c1, d1); >r : C, Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) >foo(c1, d1) : C >foo : (t: X, t2: X) => T, Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) >d1 : X, Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) var r2 = foo(c1, c1); >r2 : C, Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) >foo(c1, c1) : C >foo : (t: X, t2: X) => T, Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) function foo2(t: X, t2: X) { >foo2 : (t: X, t2: X) => T, Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) >C : C, Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) >t : X, Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 27)) >X : X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) >t2 : X, Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 35)) >X : X, Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) var x: T; >x : T, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) >T : T, Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) return x; >x : T, Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) } var r = foo2(c1, d1); >r : C, Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) >foo2(c1, d1) : C >foo2 : (t: X, t2: X) => T, Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) >d1 : X, Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) var r2 = foo2(c1, c1); >r2 : C, Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) >foo2(c1, c1) : C >foo2 : (t: X, t2: X) => T, Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) >c1 : X, Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3))