Dwarf: fix lowering of comptime-only optional pointer null values
Closes #22974
This commit is contained in:
committed by
Andrew Kelley
parent
4b0f77cc1f
commit
220f80e71d
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user