-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make std.process.execv
return type be ExecvError!noreturn
#17780
Comments
Marking as accepted based on #3257 (comment) |
I would like to review this proposal please. |
is it just me or is The only case where I could see this being useful would be in generic code. |
With this proposal you can write it as UPD: |
Hmm, that doesn't look right to me, as, if |
remember that |
Make
std.process.execv
(and similar) return type beExecvError!noreturn
, instead ofExecvError
. This plays better with the type system, and helps the user understand that the function would not return under normal circumstances.Side-effects
One way to do things
There are now two ways to do the same thing:
and
This would eliminate the first one.
Ability to use it with
try
Making this an error union rather than an error set would allow it to be used with
try
More readable code
Having the error-handling code always inside a
catch
and not dangling around after theexecv
would make it more readable and require less context to understand.As a reminder:
The text was updated successfully, but these errors were encountered: