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