mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 10:05:10 +01:00
17 lines
396 B
Zig
17 lines
396 B
Zig
const Foo = enum { a };
|
|
pub export fn entry1() void {
|
|
const arr = [_]Foo{.a};
|
|
_ = arr ++ .{.b};
|
|
}
|
|
pub export fn entry2() void {
|
|
const b = .{.b};
|
|
const arr = [_]Foo{.a};
|
|
_ = arr ++ b;
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :4:19: error: no field named 'b' in enum 'tmp.Foo'
|
|
// :1:13: note: enum declared here
|
|
// :9:16: error: no field named 'b' in enum 'tmp.Foo'
|
|
// :1:13: note: enum declared here
|