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

// error
//
// :5:28: error: no field named 'a' in struct 'tmp.Foo'
// :1:20: note: struct declared here