Zig Version
0.10.0-dev.1261+6f986298c
Steps to Reproduce
const std = @import("std");
pub fn main() !void {
var value: u4 = undefined;
std.debug.print("u4={}, usize={}\n", .{
value,
@as(usize, value),
});
}
Expected Behavior
Code prints
Actual Behavior
Code prints
It looks like the compiler is assuming that the upper bits of a u4 are 0, which doesn't happen when unitializing to undefined
Zig Version
0.10.0-dev.1261+6f986298c
Steps to Reproduce
Expected Behavior
Code prints
Actual Behavior
Code prints
It looks like the compiler is assuming that the upper bits of a
u4are 0, which doesn't happen when unitializing toundefined