TypeScript/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt

9 lines
542 B
Plaintext
Raw Normal View History

==== 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-13 01:04:16 +02:00
!!! Type '() => void' is not assignable to type '() => boolean':
!!! Type 'void' is not assignable to type 'boolean'.
var n2: () => boolean = function ():boolean { }; // expect an error here
~~~~~~~
!!! 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