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

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