zig/test/cases/compile_errors/fieldParentPtr-bad_field_name.zig
2024-03-30 20:50:48 -04:00

14 lines
255 B
Zig

const Foo = extern struct {
derp: i32,
};
export fn foo(a: *i32) *Foo {
return @fieldParentPtr("a", a);
}
// error
// backend=stage2
// target=native
//
// :5:28: error: no field named 'a' in struct 'tmp.Foo'
// :1:20: note: struct declared here