aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/struct_with_invalid_field.zig
blob: aa24b029bb734f277f13f62b266279ccbd700431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const std = @import("std",);
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;

const HeaderWeight = enum {
    H1, H2, H3, H4, H5, H6,
};

const MdText = ArrayList(u8);

const MdNode = union(enum) {
    Header: struct {
        text: MdText,
        weight: HeaderValue,
    },
};

export fn entry() void {
    const a = MdNode.Header {
        .text = MdText.init(std.testing.allocator),
        .weight = HeaderWeight.H1,
    };
    _ = a;
}

// error
// backend=stage2
// target=native
//
// :14:17: error: use of undeclared identifier 'HeaderValue'