Skip to content

fix ast gen failure to catch incorrect by ref error captures#18584

Merged
andrewrk merged 2 commits intoziglang:masterfrom
Techatrix:fix-switch-on-err
Jan 16, 2024
Merged

fix ast gen failure to catch incorrect by ref error captures#18584
andrewrk merged 2 commits intoziglang:masterfrom
Techatrix:fix-switch-on-err

Conversation

@Techatrix
Copy link
Contributor

fixes #18583

The old code that tried to detect the "switch on error" was just looking at the token relative to the payload to find what is the switch operand. This is incorrect when the switch operand is an expression like in catch |err| switch (err + 1) {}.

@andrewrk andrewrk enabled auto-merge January 16, 2024 09:14
@andrewrk
Copy link
Member

Nice, thank you!

@andrewrk andrewrk merged commit fe87041 into ziglang:master Jan 16, 2024
@Techatrix Techatrix deleted the fix-switch-on-err branch March 13, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: ast gen fails to catch incorrect by ref error captures

2 participants