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.11.0-dev.866+f24c77fc4
When trying to use @subWithOverflow in some code, I found a very confusing error message:
@subWithOverflow
example.zig:5:47: error: expected type 'u1', found 'bool' const carry = @subWithOverflow(u32, 1, 2, &result); ^~~~~~~
const std = @import("std"); pub fn main() !void { var result: u32 = 0; const carry = @subWithOverflow(u32, 1, 2, &result); var err: u1 = @as(u1, carry); std.debug.print("{d}\n", err); }
The issue is that the reported line/character is wrong when using this builtin function.
Reproduced example: https://godbolt.org/z/sz6j9E65f (0.11.0-dev.866+f24c77fc4 at the time of writing)
The problem happens when using the return value so it should be reported at the place where the return value from @subWithOverflow is used.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Zig Version
0.11.0-dev.866+f24c77fc4
Steps to Reproduce and Observed Output
When trying to use
@subWithOverflow
in some code, I found a very confusing error message:The issue is that the reported line/character is wrong when using this builtin function.
Reproduced example: https://godbolt.org/z/sz6j9E65f (
0.11.0-dev.866+f24c77fc4
at the time of writing)Expected Output
The problem happens when using the return value so it should be reported at the place where the return value from
@subWithOverflow
is used.The text was updated successfully, but these errors were encountered: