Zig Version
0.11.0-dev.811+8ff9284c4
Steps to Reproduce and Observed Behavior
pub fn main() void {
const x: []u8 = undefined;
const y: f32 = x;
_ = y;
}
The compilation completes successfully. Adding @compileLog(@TypeOf(x)) (and the same for y) shows that the types are as expected (nothing has become @Type(.Undefined)):
[mlugg@vega test]$ zig run test.zig
test.zig:3:5: error: found compile log statement
@compileLog(@TypeOf(x));
^~~~~~~~~~~~~~~~~~~~~~~
Compile Log Output:
@as(type, []u8)
@as(type, f32)
Expected Behavior
The compilation should fail with this error:
test.zig:3:20: error: expected type 'f32', found '[]u8'
const y: f32 = x;
Zig Version
0.11.0-dev.811+8ff9284c4
Steps to Reproduce and Observed Behavior
The compilation completes successfully. Adding
@compileLog(@TypeOf(x))(and the same fory) shows that the types are as expected (nothing has become@Type(.Undefined)):Expected Behavior
The compilation should fail with this error: