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
|
=== tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts ===
function foo<T>(n: { x: T; y: T }, m: T) { return m; }
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>T : Symbol(T, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 13))
>n : Symbol(n, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 16))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 20))
>T : Symbol(T, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 13))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 26))
>T : Symbol(T, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 13))
>m : Symbol(m, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 34))
>T : Symbol(T, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 13))
>m : Symbol(m, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 34))
// these are all errors
var x = foo({ x: 3, y: "" }, 4);
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 2, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 2, 13))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 2, 19))
var x2 = foo<number>({ x: 3, y: "" }, 4);
>x2 : Symbol(x2, Decl(genericCallWithObjectLiteralArguments1.ts, 3, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 3, 22))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 3, 28))
var x3 = foo<string>({ x: 3, y: "" }, 4);
>x3 : Symbol(x3, Decl(genericCallWithObjectLiteralArguments1.ts, 4, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 4, 22))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 4, 28))
var x4 = foo<number>({ x: "", y: 4 }, "");
>x4 : Symbol(x4, Decl(genericCallWithObjectLiteralArguments1.ts, 5, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 5, 22))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 5, 29))
var x5 = foo<string>({ x: "", y: 4 }, "");
>x5 : Symbol(x5, Decl(genericCallWithObjectLiteralArguments1.ts, 6, 3))
>foo : Symbol(foo, Decl(genericCallWithObjectLiteralArguments1.ts, 0, 0))
>x : Symbol(x, Decl(genericCallWithObjectLiteralArguments1.ts, 6, 22))
>y : Symbol(y, Decl(genericCallWithObjectLiteralArguments1.ts, 6, 29))
|