16 lines
711 B
Plaintext
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'.
|
|
|