mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Also modifies all incremental cases using `#expect_error` to include the errors and notes which are expected.
28 lines
727 B
Plaintext
28 lines
727 B
Plaintext
#target=x86_64-linux-selfhosted
|
|
#target=x86_64-linux-cbe
|
|
#target=x86_64-windows-cbe
|
|
#target=wasm32-wasi-selfhosted
|
|
#update=initial version
|
|
#file=main.zig
|
|
const MyEnum = enum(u8) {
|
|
foo = 1,
|
|
bar = 2,
|
|
};
|
|
pub fn main() !void {
|
|
try std.io.getStdOut().writer().print("{}\n", .{@intFromEnum(MyEnum.foo)});
|
|
}
|
|
const std = @import("std");
|
|
#expect_stdout="1\n"
|
|
#update=remove enum field
|
|
#file=main.zig
|
|
const MyEnum = enum(u8) {
|
|
//foo = 1,
|
|
bar = 2,
|
|
};
|
|
pub fn main() !void {
|
|
try std.io.getStdOut().writer().print("{}\n", .{@intFromEnum(MyEnum.foo)});
|
|
}
|
|
const std = @import("std");
|
|
#expect_error=main.zig:6:73: error: enum 'main.MyEnum' has no member named 'foo'
|
|
#expect_error=main.zig:1:16: note: enum declared here
|