aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/array_cat_invalid_elem.zig
blob: fc5b99a68be1f776d3d8482c951bdb2cbeb7bed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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