Dwarf: fix lowering of comptime-only optional pointer null values

Closes #22974
This commit is contained in:
Jacob Young
2025-02-22 11:47:22 -05:00
committed by Andrew Kelley
parent 4b0f77cc1f
commit 220f80e71d
4 changed files with 104 additions and 76 deletions

View File

@@ -656,3 +656,14 @@ test "result location initialization of optional with OPV payload" {
_ = &c;
try expectEqual(0, (c orelse return error.TestFailed).x);
}
test "global comptime only optional" {
const S = struct {
const @"null": ?*type = null;
const @"void": ?*const type = &void;
};
comptime {
assert(S.null == null);
assert(S.void.?.* == void);
}
}