zig/test/cases/compile_errors/fieldParentPtr-bad_field_name.zig
2022-06-30 09:57:38 +02:00

14 lines
260 B
Zig

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