| ... | ... | @@ -402,7 +402,9 @@ pub fn zeroes(comptime T: type) T { |
| 402 | 402 | } |
| 403 | 403 | return [_]info.child{zeroes(info.child)} ** info.len; |
| 404 | 404 | }, |
| 405 | | .Vector, |
| 405 | .Vector => |info| { |
| 406 | return @splat(info.len, zeroes(info.child)); |
| 407 | }, |
| 406 | 408 | .ErrorUnion, |
| 407 | 409 | .ErrorSet, |
| 408 | 410 | .Union, |
| ... | ... | @@ -458,6 +460,9 @@ test "mem.zeroes" { |
| 458 | 460 | }, |
| 459 | 461 | |
| 460 | 462 | array: [2]u32, |
| 463 | vector_u32: meta.Vector(2, u32), |
| 464 | vector_f32: meta.Vector(2, f32), |
| 465 | vector_bool: meta.Vector(2, bool), |
| 461 | 466 | optional_int: ?u8, |
| 462 | 467 | empty: void, |
| 463 | 468 | sentinel: [3:0]u8, |
| ... | ... | @@ -484,6 +489,9 @@ test "mem.zeroes" { |
| 484 | 489 | for (b.array) |e| { |
| 485 | 490 | testing.expectEqual(@as(u32, 0), e); |
| 486 | 491 | } |
| 492 | testing.expectEqual(@splat(2, @as(u32, 0)), b.vector_u32); |
| 493 | testing.expectEqual(@splat(2, @as(f32, 0.0)), b.vector_f32); |
| 494 | testing.expectEqual(@splat(2, @as(bool, false)), b.vector_bool); |
| 487 | 495 | testing.expectEqual(@as(?u8, null), b.optional_int); |
| 488 | 496 | for (b.sentinel) |e| { |
| 489 | 497 | testing.expectEqual(@as(u8, 0), e); |