value: handle slices in canMutateComptimeVarState

This commit is contained in:
Veikka Tuominen
2022-06-18 20:04:49 +03:00
parent 33cf6ef621
commit 8f9b31af92
2 changed files with 1 additions and 1 deletions

View File

@@ -2080,7 +2080,6 @@ fn testReadIntImpl() !void {
}
test "writeIntSlice" {
if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
try testWriteIntImpl();
comptime try testWriteIntImpl();
}

View File

@@ -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,
}
}