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
pubfnatomicSymLink(allocator: &Allocator, existing_path: []constu8, new_path: []constu8) !void {
if (symLink(allocator, existing_path, new_path)) {
return;
} else|err|switch (err) {
error.PathAlreadyExists=> {},
else=>returnerr, // TODO zig should know this set does not include PathAlreadyExists
}
...
}
It should not be possible for atomicSymLink to return error.PathAlreadyExists.
In this example, subset has exactly the same value as err, except that it has a different type. The type is @typeOf(err) except the error set does not have any of the errors covered by the switch prongs above.
If the type of subset would be error{} then the else is dead code.
The text was updated successfully, but these errors were encountered:
andrewrk
added
the
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
label
Feb 11, 2018
This now works for the else capture value. What's left to do before closing is supporting a capture value when there are multiple error cases specified (the example in #769 (comment))
It should not be possible for
atomicSymLink
to returnerror.PathAlreadyExists
.Here's my proposal:
In this example,
subset
has exactly the same value aserr
, except that it has a different type. The type is@typeOf(err)
except the error set does not have any of the errors covered by the switch prongs above.If the type of
subset
would beerror{}
then the else is dead code.The text was updated successfully, but these errors were encountered: