zig/test/cases/compile_errors/bitcast_undef.zig
mlugg 03ad862197
compiler: un-implement #19634
This commit reverts the handling of partially-undefined values in
bitcasting to transform these bits into an arbitrary numeric value,
like happens on `master` today.

As @andrewrk rightly points out, #19634 has unfortunate consequences
for the standard library, and likely requires more thought. To avoid
a major breaking change, it has been decided to revert this design
decision for now, and make a more informed decision further down the
line.
2024-04-17 13:41:25 +01:00

12 lines
216 B
Zig

export fn entry1() void {
const x: i32 = undefined;
const y: u32 = @bitCast(x);
@compileLog(y);
}
// error
//
// :4:5: error: found compile log statement
//
// Compile Log Output:
// @as(u32, undefined)