TypeScript/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt
Anders Hejlsberg a515b199b7 Better error messages in function calls.
Fixes #93.
This is an evolution of #220.
2014-07-24 17:00:03 -07:00

16 lines
No EOL
699 B
Text

==== tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts (2 errors) ====
interface IResultCallback extends Function {
x: number;
}
function fn(cb: IResultCallback) { }
fn((a, b) => true);
~~~~~~~~~~~~~~
!!! Argument type '(a: any, b: any) => boolean' is not assignable to parameter type 'IResultCallback'.
!!! Property 'x' is missing in type '(a: any, b: any) => boolean'.
fn(function (a, b) { return true; })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Argument type '(a: any, b: any) => boolean' is not assignable to parameter type 'IResultCallback'.
!!! Property 'x' is missing in type '(a: any, b: any) => boolean'.