We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.10.1
Minimal reproduction here: https://github.com/proqqul/RHS-first Just run zig build test
zig build test
const expect = @import("std").testing.expect; const Struct = struct { a: bool, b: bool, }; test "RHS first" { var s = Struct{ .a = true, .b = true, }; // RHS should be evaluated first, yielding .{ .a = false, .b = true} before // assignment occurs. In fact, we see the opposite, and s.a gets assigned // `false` before s.a gets evaluated in the next line. s = .{ .a = false, .b = s.a, }; try expect(s.b); }
RHS of assignment will be fully evaluated before assignment occurs
The text was updated successfully, but these errors were encountered:
whoops! duplicate of #12064
Sorry, something went wrong.
No branches or pull requests
Zig Version
0.10.1
Steps to Reproduce and Observed Behavior
Minimal reproduction here: https://github.com/proqqul/RHS-first
Just run
zig build test
Expected Behavior
RHS of assignment will be fully evaluated before assignment occurs
The text was updated successfully, but these errors were encountered: