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
It becomes weirder if I have another try in the function. Now it does compile, but the compiler doesn't know about the possible error values from the return expression.
./asdf12.zig:6:17: error: error sets '@TypeOf(openDataFile).ReturnType.ErrorSet' and 'error{FileNotFound}' have no common errors
if (err == error.FileNotFound) {
^
Note: I think this is a recent (as in the last week or two?) regression.
The text was updated successfully, but these errors were encountered:
andrewrk
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
Mar 8, 2020
It also fails using
return if (mode == .read) ... else ...;
.I can get it to work by adding
try
s:return try switch (mode) { ... };
return switch (mode) { .read => try ... , .write => try ... };
Or by returning inside the switch statement:
switch (mode) { .read => return ..., .write => return ... }
Or by assigning the conditional expression then returning the variable:
const x = switch (mode) { .read => ... , .write => ... }; return x;
It becomes weirder if I have another
try
in the function. Now it does compile, but the compiler doesn't know about the possible error values from the return expression.Note: I think this is a recent (as in the last week or two?) regression.
The text was updated successfully, but these errors were encountered: