mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
Dwarf: implement pointers to more comptime values
Closes #30600 Closes #30602
This commit is contained in:
committed by
Andrew Kelley
parent
8669898819
commit
ac64c75876
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user