Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.2k
switch on error preserves error return trace #18591
Copy link
Copy link
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.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
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.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Zig Version
0.12.0-dev.2139+e025ad7b4
Steps to Reproduce and Observed Behavior
Run the following code with
zig run file.zig:This will yield the following error return trace:
I have reduced this example from usage of
std.zig.Ast.parse:The equivalent of the
foofunction in the reduced example would beexpectTopLevelDeclRecoverable.zig/lib/std/zig/Parse.zig
Lines 670 to 678 in c724cc6
Expected Behavior
The error return trace should not include the
failurefunction because theNonFatalerror is being ignored in thefoofunction.This is also what Zig 0.11.0 would produce.
I suspect that this has been caused by #18173.