Skip to content

Commit 727d152

Browse files
committed
compiler: un-implement ziglang#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, ziglang#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.
1 parent 01a2a5b commit 727d152

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

compile_errors/bitcast_undef.zig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@ export fn entry1() void {
44
@compileLog(y);
55
}
66

7-
export fn entry2() void {
8-
const x: packed struct { x: u16, y: u16 } = .{ .x = 123, .y = undefined };
9-
const y: u32 = @bitCast(x);
10-
@compileLog(y);
11-
}
12-
137
// error
148
//
159
// :4:5: error: found compile log statement
16-
// :10:5: note: also here
1710
//
1811
// Compile Log Output:
1912
// @as(u32, undefined)
20-
// @as(u32, undefined)

0 commit comments

Comments
 (0)