Sema: add missing validateRuntimeValue calls

Resolves: #13791
This commit is contained in:
mlugg
2025-02-06 01:11:10 +00:00
parent 164700740b
commit 75ec7d863e
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
export fn foo() void {
comptime var elems: [3]u32 = undefined;
for (&elems) |*elem| {
_ = elem;
}
}
// error
//
// :3:10: error: runtime value contains reference to comptime var
// :3:10: note: comptime var pointers are not available at runtime
// :2:34: note: 'runtime_value' points to comptime var declared here