-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Description
Zig Version
0.11.0-dev.3+0bbb00035
Steps to Reproduce and Observed Behavior
fn foo() !void {
return error.UhOh;
}
pub fn main() !void {
var i: usize = 0;
while (i < 3) : (i += 1) {
foo() catch continue;
}
return error.UnrelatedError;
}results in error.UhOh erroneously showing up in the trace multiple times:
> zig run 1923.zig
error: UnrelatedError
C:/Users/Ryan/Programming/Zig/tmp/1923.zig:2:5: 0x7ff71319128e in foo (1923.exe.obj)
return error.UhOh;
^
C:/Users/Ryan/Programming/Zig/tmp/1923.zig:2:5: 0x7ff71319128e in foo (1923.exe.obj)
return error.UhOh;
^
C:/Users/Ryan/Programming/Zig/tmp/1923.zig:2:5: 0x7ff71319128e in foo (1923.exe.obj)
return error.UhOh;
^
C:/Users/Ryan/Programming/Zig/tmp/1923.zig:10:5: 0x7ff7131913ef in main (1923.exe.obj)
return error.UnrelatedError;
^
(related to #12837 and #1923 (cc @topolarity))
Also worth noting that if the catch continue is changed to catch break then error.UhOh (correctly) doesn't show up in the trace.
Expected Behavior
> zig run 1923.zig
error: UnrelatedError
C:/Users/Ryan/Programming/Zig/tmp/1923.zig:10:5: 0x7ff7131913ef in main (1923.exe.obj)
return error.UnrelatedError;
^
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.