Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_ allowed as an errdefer capture assigning it to @"_" rather than discarding #20370

Closed
xdBronch opened this issue Jun 21, 2024 · 0 comments · Fixed by #21368
Closed

_ allowed as an errdefer capture assigning it to @"_" rather than discarding #20370

xdBronch opened this issue Jun 21, 2024 · 0 comments · Fixed by #21368
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@xdBronch
Copy link
Contributor

Zig Version

0.14.0-dev.107+e03026507

Steps to Reproduce and Observed Behavior

pub fn main() !void {
    errdefer |_| std.debug.print("err {}\n", .{@"_"});
    return error.a;
}

prints err error.a at runtime

Expected Behavior

should give an error in the same way catch |_| does
discard of error capture; omit it instead

@xdBronch xdBronch added the bug Observed behavior contradicts documented or intended behavior label Jun 21, 2024
@Vexu Vexu added the frontend Tokenization, parsing, AstGen, Sema, and Liveness. label Jun 21, 2024
@Vexu Vexu added this to the 0.14.0 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants