Dwarf: implement pointers to more comptime values

Closes #30600
Closes #30602
This commit is contained in:
Jacob Young
2026-01-03 02:55:18 -05:00
committed by Andrew Kelley
parent 8669898819
commit ac64c75876
3 changed files with 126 additions and 16 deletions
+10
View File
@@ -2174,3 +2174,13 @@ test "avoid unused field function body compile error" {
try expect(Case.entry() == 1);
}
test "pass a pointer to a comptime-only struct field to a function" {
const S = struct {
fn checkField(field_ptr: *const type) !void {
try expect(field_ptr.* == u42);
}
};
const s: struct { x: type } = .{ .x = u42 };
try S.checkField(&s.x);
}