diff --git a/src/value.zig b/src/value.zig index fb9a2f826a915c2250a135a9dbce503ae6f898c3..24f6b1df75bb4287718e4654c17410542c17be91 100644 --- a/src/value.zig +++ b/src/value.zig @@ -526,7 +526,15 @@ pub const Value = extern union { }; return Value{ .ptr_otherwise = &new_payload.base }; }, - .bytes => return self.copyPayloadShallow(arena, Payload.Bytes), + .bytes => { + const bytes = self.castTag(.bytes).?.data; + const new_payload = try arena.create(Payload.Bytes); + new_payload.* = .{ + .base = .{ .tag = .bytes }, + .data = try arena.dupe(u8, bytes), + }; + return Value{ .ptr_otherwise = &new_payload.base }; + }, .repeated, .eu_payload, .opt_payload, diff --git a/test/behavior/cast.zig b/test/behavior/cast.zig index 003b1b7bec71b737ca8c2ccb5dfb5cb010ce1ee3..4bb8f147ece65befbee4be07bd49abdfe30c2cfb 100644 --- a/test/behavior/cast.zig +++ b/test/behavior/cast.zig @@ -462,7 +462,7 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { } test "implicit cast from *const [N]T to []const T" { - if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO try testCastConstArrayRefToConstSlice(); comptime try testCastConstArrayRefToConstSlice();