TypeScript Version: 2.4.2
Code
Object.freeze({
foo() {
return Object.freeze('a');
},
});
(with --strict)
Expected behavior:
Accepted in 2.3 and 2.4.
Actual behavior:
In 2.4: 'foo' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
Note that the TS playground currently is 2.3.3, so you can't reproduce this on there.
TypeScript Version: 2.4.2
Code
(with
--strict)Expected behavior:
Accepted in 2.3 and 2.4.
Actual behavior:
In 2.4: 'foo' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
Note that the TS playground currently is 2.3.3, so you can't reproduce this on there.