a515b199b7
Fixes #93. This is an evolution of #220.
16 lines
No EOL
699 B
Text
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'.
|
|
|