TypeScript/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt
2014-09-12 13:35:07 -07:00

22 lines
577 B
Plaintext

tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,1): error TS2354: No best common type exists among return expressions.
==== 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.