-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Returning an error from an error union with a 0 length array fails with -ofmt=c #20881
Labels
Milestone
Comments
MasonRemaley
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Jul 31, 2024
I was able to reduce this further: test {
g(error.E, .{});
}
pub fn g(a: anyerror, b: anyerror![0]u8) void {
if (b) |v| {
h(.{ a, v });
} else |err| {
h(.{ a, err });
}
}
pub fn h(_: anytype) void {} Here's the output of Stack trace
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zig Version
0.14.0-dev.737+30b4a87db
Steps to Reproduce and Observed Behavior
Minimal repro thanks to @ianprime0509:
Stack trace
Expected Behavior
I expected the test to pass.
The text was updated successfully, but these errors were encountered: