Commit 8f9b31af92

Veikka Tuominen <git@vexu.eu>
2022-06-18 19:04:49
value: handle slices in canMutateComptimeVarState
1 parent 33cf6ef
Changed files (2)
lib
src
lib/std/mem.zig
@@ -2080,7 +2080,6 @@ fn testReadIntImpl() !void {
 }
 
 test "writeIntSlice" {
-    if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
     try testWriteIntImpl();
     comptime try testWriteIntImpl();
 }
src/value.zig
@@ -2414,6 +2414,7 @@ pub const Value = extern union {
                 return false;
             },
             .@"union" => return val.cast(Payload.Union).?.data.val.canMutateComptimeVarState(),
+            .slice => return val.castTag(.slice).?.data.ptr.canMutateComptimeVarState(),
             else => return false,
         }
     }