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 02:00:03 +02:00
|
|
|
~~~~~~~~~~~~~~
|
2014-07-25 04:39:50 +02:00
|
|
|
!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'.
|
2014-07-25 02:00:03 +02:00
|
|
|
!!! 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 02:00:03 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2014-07-25 04:39:50 +02:00
|
|
|
!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'.
|
2014-07-25 02:00:03 +02:00
|
|
|
!!! Property 'x' is missing in type '(a: any, b: any) => boolean'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|