21 lines
310 B
TypeScript
21 lines
310 B
TypeScript
//// [inferredFunctionReturnTypeIsEmptyType.ts]
|
|
function foo() {
|
|
if (true) {
|
|
return 42;
|
|
}
|
|
else {
|
|
return "42";
|
|
}
|
|
};
|
|
|
|
|
|
//// [inferredFunctionReturnTypeIsEmptyType.js]
|
|
function foo() {
|
|
if (true) {
|
|
return 42;
|
|
}
|
|
else {
|
|
return "42";
|
|
}
|
|
}
|
|
;
|