2014-09-12 22:35:07 +02:00
|
|
|
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";
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
}
|
|
|
|
~~~~~
|
|
|
|
};
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2354: No best common type exists among return expressions.
|
2014-07-13 01:04:16 +02:00
|
|
|
|