aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-04-16 21:49:08 +0100
committermlugg <mlugg@mlugg.co.uk>2024-04-17 13:41:25 +0100
commit03ad862197d27fb079d16cabdf2026da23aa2653 (patch)
tree4a93dcada35e3bf50521efaa41679688cb16ab26 /test
parent66630f6c93da0d219d74026742c1cb5f64e858e8 (diff)
downloadzig-03ad862197d27fb079d16cabdf2026da23aa2653.tar.gz
zig-03ad862197d27fb079d16cabdf2026da23aa2653.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/cases/compile_errors/bitcast_undef.zig8
1 files changed, 0 insertions, 8 deletions
diff --git a/test/cases/compile_errors/bitcast_undef.zig b/test/cases/compile_errors/bitcast_undef.zig
index 7b4a671672..fe9b40e463 100644
--- a/test/cases/compile_errors/bitcast_undef.zig
+++ b/test/cases/compile_errors/bitcast_undef.zig
@@ -4,17 +4,9 @@ export fn entry1() void {
@compileLog(y);
}
-export fn entry2() void {
- const x: packed struct { x: u16, y: u16 } = .{ .x = 123, .y = undefined };
- const y: u32 = @bitCast(x);
- @compileLog(y);
-}
-
// error
//
// :4:5: error: found compile log statement
-// :10:5: note: also here
//
// Compile Log Output:
// @as(u32, undefined)
-// @as(u32, undefined)