15 lines
458 B
Plaintext
15 lines
458 B
Plaintext
tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,10): error TS2354: No best common type exists among return expressions.
|
|
|
|
|
|
==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ====
|
|
function foo() {
|
|
~~~
|
|
!!! error TS2354: No best common type exists among return expressions.
|
|
if (true) {
|
|
return 42;
|
|
}
|
|
else {
|
|
return "42";
|
|
}
|
|
};
|
|
|