| ... | @@ -585,26 +585,26 @@ test "switch prong pointer capture alignment" { | ... | @@ -585,26 +585,26 @@ test "switch prong pointer capture alignment" { |
| 585 | fn doTheTest() !void { | 585 | fn doTheTest() !void { |
| 586 | const u = U{ .a = 1 }; | 586 | const u = U{ .a = 1 }; |
| 587 | switch (u) { | 587 | switch (u) { |
| 588 | .a => |*a| try expectEqual(*align(8) const u8, @TypeOf(a)), | 588 | .a => |*a| comptime assert(@TypeOf(a) == *align(8) const u8), |
| 589 | .b, .c => |*p| { | 589 | .b, .c => |*p| { |
| 590 | _ = p; | 590 | _ = p; |
| 591 | @panic("fail"); | 591 | return error.TestFailed; |
| 592 | }, | 592 | }, |
| 593 | } | 593 | } |
| 594 | | 594 | |
| 595 | switch (u) { | 595 | switch (u) { |
| 596 | .a, .b => |*p| try expectEqual(*align(4) const u8, @TypeOf(p)), | 596 | .a, .b => |*p| comptime assert(@TypeOf(p) == *align(4) const u8), |
| 597 | .c => |*p| { | 597 | .c => |*p| { |
| 598 | _ = p; | 598 | _ = p; |
| 599 | @panic("fail"); | 599 | return error.TestFailed; |
| 600 | }, | 600 | }, |
| 601 | } | 601 | } |
| 602 | | 602 | |
| 603 | switch (u) { | 603 | switch (u) { |
| 604 | .a, .c => |*p| try expectEqual(*const u8, @TypeOf(p)), | 604 | .a, .c => |*p| comptime assert(@TypeOf(p) == *const u8), |
| 605 | .b => |*p| { | 605 | .b => |*p| { |
| 606 | _ = p; | 606 | _ = p; |
| 607 | @panic("fail"); | 607 | return error.TestFailed; |
| 608 | }, | 608 | }, |
| 609 | } | 609 | } |
| 610 | } | 610 | } |
| ... | @@ -612,19 +612,19 @@ test "switch prong pointer capture alignment" { | ... | @@ -612,19 +612,19 @@ test "switch prong pointer capture alignment" { |
| 612 | fn doTheTest2() !void { | 612 | fn doTheTest2() !void { |
| 613 | const un1 = U{ .b = 1 }; | 613 | const un1 = U{ .b = 1 }; |
| 614 | switch (un1) { | 614 | switch (un1) { |
| 615 | .b => |*a| try expectEqual(*align(4) const u8, @TypeOf(a)), | 615 | .b => |*b| comptime assert(@TypeOf(b) == *align(4) const u8), |
| 616 | .a, .c => |*p| { | 616 | .a, .c => |*p| { |
| 617 | _ = p; | 617 | _ = p; |
| 618 | @panic("fail"); | 618 | return error.TestFailed; |
| 619 | }, | 619 | }, |
| 620 | } | 620 | } |
| 621 | | 621 | |
| 622 | const un2 = U{ .c = 1 }; | 622 | const un2 = U{ .c = 1 }; |
| 623 | switch (un2) { | 623 | switch (un2) { |
| 624 | .c => |*a| try expectEqual(*const u8, @TypeOf(a)), | 624 | .c => |*c| comptime assert(@TypeOf(c) == *const u8), |
| 625 | .a, .b => |*p| { | 625 | .a, .b => |*p| { |
| 626 | _ = p; | 626 | _ = p; |
| 627 | @panic("fail"); | 627 | return error.TestFailed; |
| 628 | }, | 628 | }, |
| 629 | } | 629 | } |
| 630 | } | 630 | } |