-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
const std = @import("std");
pub fn main() void {
var fast = true;
var very_fast = false;
const num_frames = if (fast)
@as(u32, if (very_fast) 16 else 4)
//if (very_fast) @as(u32, 16) else @as(u32, 4)
else
1;
std.debug.warn("{}\n", .{num_frames});
}This prints 16. The commented out line works normally (prints 4).
Broken on both Zig 0.7.1 and 0.8.0-dev.2711+11ae6c42c
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.