aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/offsetOf-bad_field_name.zig
blob: ceded4f6189b1eadf24627b8c9ff3cd4571a0007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const Foo = struct {
    derp: i32,
};
export fn foo() usize {
    return @offsetOf(
        Foo,
        "a",
    );
}

// error
// backend=stage2
// target=native
//
// :7:9: error: no field named 'a' in struct 'tmp.Foo'
// :1:13: note: struct declared here