mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
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.
13 lines
216 B
Zig
13 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)
|