2014-11-05 21:26:03 +01:00
tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'.
2014-09-12 22:35:07 +02:00
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.
2014-07-19 00:19:23 +02:00
==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ====
2014-07-13 01:04:16 +02:00
var n1: () => boolean = function () { }; // expect an error here
2014-07-19 02:30:06 +02:00
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
2014-07-13 01:04:16 +02:00
var n2: () => boolean = function ():boolean { }; // expect an error here
2014-07-19 00:19:23 +02:00
~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
2014-07-13 01:04:16 +02:00