| ... | @@ -130,3 +130,17 @@ test "Type.Undefined" { | ... | @@ -130,3 +130,17 @@ test "Type.Undefined" { |
| 130 | test "Type.Null" { | 130 | test "Type.Null" { |
| 131 | testTypes(&[_]type{@typeOf(null)}); | 131 | testTypes(&[_]type{@typeOf(null)}); |
| 132 | } | 132 | } |
| | 133 | test "@Type create slice with null sentinel" { |
| | 134 | const Slice = @Type(builtin.TypeInfo{ |
| | 135 | .Pointer = .{ |
| | 136 | .size = .Slice, |
| | 137 | .is_const = true, |
| | 138 | .is_volatile = false, |
| | 139 | .is_allowzero = false, |
| | 140 | .alignment = 8, |
| | 141 | .child = *i32, |
| | 142 | .sentinel = null, |
| | 143 | }, |
| | 144 | }); |
| | 145 | testing.expect(Slice == []align(8) const *i32); |
| | 146 | } |