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
functionf1<r>(): r{thrownewError(String(Math.random()));// nothing to it so far}functionf2<r>(): r{debugger;thrownewError(String(Math.random()));// all hell breaks loose}
This is because the compiler does not do control flow analysis at this point. it would be a restriction that can be relaxed once this support is added.
An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
live demo
The text was updated successfully, but these errors were encountered: