2014-07-13 01:04:16 +02:00
|
|
|
//// [genericCallWithObjectLiteralArguments1.ts]
|
|
|
|
function foo<T>(n: { x: T; y: T }, m: T) { return m; }
|
|
|
|
// these are all errors
|
2014-10-22 00:32:45 +02:00
|
|
|
var x = foo({ x: 3, y: "" }, 4);
|
2014-07-13 01:04:16 +02:00
|
|
|
var x2 = foo<number>({ x: 3, y: "" }, 4);
|
|
|
|
var x3 = foo<string>({ x: 3, y: "" }, 4);
|
|
|
|
var x4 = foo<number>({ x: "", y: 4 }, "");
|
|
|
|
var x5 = foo<string>({ x: "", y: 4 }, "");
|
|
|
|
|
|
|
|
//// [genericCallWithObjectLiteralArguments1.js]
|
|
|
|
function foo(n, m) {
|
|
|
|
return m;
|
|
|
|
}
|
2014-08-12 00:54:12 +02:00
|
|
|
// these are all errors
|
2014-10-22 00:32:45 +02:00
|
|
|
var x = foo({ x: 3, y: "" }, 4);
|
2014-07-13 01:04:16 +02:00
|
|
|
var x2 = foo({ x: 3, y: "" }, 4);
|
|
|
|
var x3 = foo({ x: 3, y: "" }, 4);
|
|
|
|
var x4 = foo({ x: "", y: 4 }, "");
|
|
|
|
var x5 = foo({ x: "", y: 4 }, "");
|