| ... | ... | @@ -763,6 +763,26 @@ pub fn addCases(ctx: *TestContext) !void { |
| 763 | 763 | ":4:5: error: '_' prong only allowed when switching on non-exhaustive enums", |
| 764 | 764 | ":7:11: note: '_' prong here", |
| 765 | 765 | }); |
| 766 | |
| 767 | case.addError( |
| 768 | \\const E = enum { a, b, c }; |
| 769 | \\export fn foo() void { |
| 770 | \\ var x = E.d; |
| 771 | \\} |
| 772 | , &.{ |
| 773 | ":3:14: error: enum 'E' has no member named 'd'", |
| 774 | ":1:11: note: enum declared here", |
| 775 | }); |
| 776 | |
| 777 | case.addError( |
| 778 | \\const E = enum { a, b, c }; |
| 779 | \\export fn foo() void { |
| 780 | \\ var x: E = .d; |
| 781 | \\} |
| 782 | , &.{ |
| 783 | ":3:17: error: enum 'E' has no field named 'd'", |
| 784 | ":1:11: note: enum declared here", |
| 785 | }); |
| 766 | 786 | } |
| 767 | 787 | |
| 768 | 788 | ctx.c("empty start function", linux_x64, |