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

16 lines
711 B
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts (2 errors) ====
interface IResultCallback extends Function {
x: number;
}
function fn(cb: IResultCallback) { }
fn((a, b) => true);
~~~~~~~~~~~~~~
2014-07-25 04:39:50 +02:00
!!! 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'.
2014-07-13 01:04:16 +02:00
fn(function (a, b) { return true; })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-07-25 04:39:50 +02:00
!!! 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'.
2014-07-13 01:04:16 +02:00