Zig Version
0.10.0-dev.3672+cd5a9ba1f
Steps to Reproduce
const std = @import("std");
test {
var a: u32 = 45;
_ = &a;
var b: u8 = 4;
_ = &b;
var runtime = true;
_ = &runtime;
var other = false;
_ = &other;
const x = if (runtime) blk: {
break :blk a;
} else if (other) blk: {
break :blk b;
} else null;
try std.testing.expectEqual(?u32, @TypeOf(x));
// try std.testing.expect(x == 45); // see #12609
}
Expected Behavior
Actual Behavior
test.zig:14:15: error: expected type '?u32', found '?u8'
const x = if (runtime) blk: {
^~
test.zig:14:15: note: optional type child 'u8' cannot cast into optional type child 'u32'
Zig Version
0.10.0-dev.3672+cd5a9ba1f
Steps to Reproduce
Expected Behavior
Actual Behavior