You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// compilesfunctionfoo(): number{thrownewError('Everything is gonna be alright!');}// does not compileconstbar: ()=>number=()=>{thrownewError('WHYUNO?!?');}
Expected behavior:
Functions foo and bar type-check, because an exception is thrown in their body which effectively means "bottom", so any return type should be permitted.
Actual behavior:
While function foo type-checks, bar does not.
TypeScript Version:
1.8
Code
Expected behavior:
Functions
fooandbartype-check, because an exception is thrown in their body which effectively means "bottom", so any return type should be permitted.Actual behavior:
While function
footype-checks,bardoes not.