I guess I’m not tuned in enough, because I don’t understand the proposal.
How does this improve on (?)?
How does this improve on (?)?
fn foo(b : bool) -> Result<Bar,Baz> {
...
return Ok(bar);
...
return Err(baz);
}
you can type: fn foo() -> Bar throws Baz {
...
return bar;
...
throw baz; //or yeet, in this proposal
}
and it works exactly identically as the first example. ? still works inside the function just as it normally would. I find the proposal sort of pointless, but also totally harmless, so why not.So in a sense it actually is very similar to `throw` in traditional languages, as it can be caught inside the same function and isn't forced to `return` the error outside the function.