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

22 lines
577 B
Plaintext
Raw Normal View History

tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,1): error TS2354: No best common type exists among return expressions.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ====
function foo() {
~~~~~~~~~~~~~~~~
if (true) {
~~~~~~~~~~~~~~~
return 42;
~~~~~~~~~~~~~~~~~~
}
~~~~~
else {
~~~~~~~~~~
return "42";
~~~~~~~~~~~~~~~~~~~~
}
~~~~~
};
~
!!! error TS2354: No best common type exists among return expressions.
2014-07-13 01:04:16 +02:00