-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
arch-x86_6464-bit x8664-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
Zig Version
0.15.1
Steps to Reproduce and Observed Behavior
compile the following snippet
pub fn main() !void {
var value: ??u8 = null;
value = 1;
std.debug.print("{}\n", .{value == 1});
}
const std = @import("std");and the compiler fails with
error: failed to select cmp_eq ??u8 |(none)| dx |(none)| si
pub fn main() !void {
~~~~^~~~~~~~~~~~~~~
It doesn't fail with
pub fn main() !void {
const value: ??u8 = 1;
std.debug.print("{}\n", .{value == 1});
}
const std = @import("std");Expected Behavior
The snippet should be compiled fine and prints out true
Metadata
Metadata
Assignees
Labels
arch-x86_6464-bit x8664-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior