mirror of
https://github.com/ziglang/zig.git
synced 2026-01-26 01:05:22 +00:00
stage2: add remaining enum compile error test cases
This commit is contained in:
parent
57aa289fde
commit
7595915775
@ -763,6 +763,26 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
":4:5: error: '_' prong only allowed when switching on non-exhaustive enums",
|
||||
":7:11: note: '_' prong here",
|
||||
});
|
||||
|
||||
case.addError(
|
||||
\\const E = enum { a, b, c };
|
||||
\\export fn foo() void {
|
||||
\\ var x = E.d;
|
||||
\\}
|
||||
, &.{
|
||||
":3:14: error: enum 'E' has no member named 'd'",
|
||||
":1:11: note: enum declared here",
|
||||
});
|
||||
|
||||
case.addError(
|
||||
\\const E = enum { a, b, c };
|
||||
\\export fn foo() void {
|
||||
\\ var x: E = .d;
|
||||
\\}
|
||||
, &.{
|
||||
":3:17: error: enum 'E' has no field named 'd'",
|
||||
":1:11: note: enum declared here",
|
||||
});
|
||||
}
|
||||
|
||||
ctx.c("empty start function", linux_x64,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user