14 lines
No EOL
983 B
Text
14 lines
No EOL
983 B
Text
tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'.
|
|
Type 'void' is not assignable to type 'boolean'.
|
|
tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
|
|
|
|
==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ====
|
|
var n1: () => boolean = function () { }; // expect an error here
|
|
~~
|
|
!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'.
|
|
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
|
|
var n2: () => boolean = function ():boolean { }; // expect an error here
|
|
~~~~~~~
|
|
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
|