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

15 lines
458 B
Plaintext
Raw Normal View History

tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,10): 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() {
~~~
!!! 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";
}
};