14 lines
726 B
Text
14 lines
726 B
Text
|
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target.
|
||
|
|
||
|
|
||
|
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts (1 errors) ====
|
||
|
function foo<T>(x: { bar: T; baz: T }) {
|
||
|
return x;
|
||
|
}
|
||
|
|
||
|
var r = foo({ bar: 1, baz: '' }); // error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||
|
var r2 = foo({ bar: 1, baz: 1 }); // T = number
|
||
|
var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo
|
||
|
var r4 = foo<Object>({ bar: 1, baz: '' }); // T = Object
|