TypeScript/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt

12 lines
680 B
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ====
function foo(x: { id: number; name?: string; }): void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Function implementation expected.
foo({ id: 1234 }); // Ok
foo({ id: 1234, name: "hello" }); // Ok
foo({ id: 1234, name: false }); // Error, name of wrong type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
foo({ name: "hello" }); // Error, id required but missing
~~~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.