zig/test/behavior/bugs/6850.zig
2022-12-06 19:06:48 -07:00

13 lines
248 B
Zig

const std = @import("std");
test "lazy sizeof comparison with zero" {
const Empty = struct {};
const T = *Empty;
try std.testing.expect(hasNoBits(T));
}
fn hasNoBits(comptime T: type) bool {
return @sizeOf(T) == @sizeOf(*i32);
}