Commit 6fc71835c3
Changed files (2)
src
test
behavior
src/value.zig
@@ -2621,6 +2621,7 @@ pub const Value = extern union {
.zero,
.one,
+ .null_value,
.int_u64,
.int_i64,
.int_big_positive,
test/behavior/generics.zig
@@ -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)));
+}