Description
Bug Report
π Search Terms
lacks ending
π Version & Regression Information
- This changed between versions 5.0.2 and 5.1.0-dev.20230323
I believe this caused it.
β― Playground Link
π» Code
function test(): unknown {
if (Math.random() > 0.5) return true;
}
π Actual behavior
> tsc --noEmit
index.ts:1:18 - error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
1 function test(): unknown {
~~~~~~~
π Expected behavior
No error, if the function return type is unknown
I'd expect that to allow implicit return of undefined
.