TypeScript/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt
2014-07-24 19:39:50 -07:00

16 lines
711 B
Plaintext

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