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
For example, this code:
const std = @import("std"); const assert = std.debug.assert; test "truncate.u0.literal" { var z = @truncate(u0, 0); assert(z == 0); } test "truncate.u0.const" { const c0: usize = 0; var z = @truncate(u0, c0); assert(z == 0); } test "truncate.u0.var" { var d: u8 = 2; var z = @truncate(u0, d); assert(z == 0); }
Causes the compiler to generate an error:
$ zig test truncate-u0.zig Trunc only produces integer trunc i8 %1 to void, !dbg !664 LLVM ERROR: Broken module found, compilation aborted!
But If I comment out test "truncate.u0.var" the first two tests for literal and const work:
test "truncate.u0.var"
$ zig test truncate-u0.zig Test 1/2 truncate.u0.literal...OK Test 2/2 truncate.u0.const...OK All tests passed.
The text was updated successfully, but these errors were encountered:
The actual source is here.
Sorry, something went wrong.
@intCast(u0, <var>)
caf672c
No branches or pull requests
For example, this code:
Causes the compiler to generate an error:
But If I comment out
test "truncate.u0.var"
the first two tests for literal and const work:The text was updated successfully, but these errors were encountered: