value: properly hash null_value pointer

Closes #13325
This commit is contained in:
Veikka Tuominen committed 2022-10-28 13:31:16 +03:00
1 parent c3b85e4e2f
commit 6fc71835c3
2 files changed
+10

No files matched your search

+1
View File
@@ -2621,6 +2621,7 @@ pub const Value = extern union {
.zero,
.one,
.null_value,
.int_u64,
.int_i64,
.int_big_positive,
+9
View File
@@ -396,3 +396,12 @@ test "slice as parameter type" {
try expect(S.internComptimeString(source_a[1..2]) == S.internComptimeString(source_a[1..2]));
try expect(S.internComptimeString(source_a[2..4]) != S.internComptimeString(source_a[5..7]));
}
test "null sentinel pointer passed as generic argument" {
const S = struct {
fn doTheTest(a: anytype) !void {
try std.testing.expect(@ptrToInt(a) == 8);
}
};
try S.doTheTest((@intToPtr([*:null]const [*c]const u8, 8)));
}