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

11 lines
189 B
Zig

const Foo = i32;
export fn foo(a: *i32) *Foo {
return @fieldParentPtr(Foo, "a", a);
}
// error
// backend=stage2
// target=native
//
// :3:28: error: expected struct type, found 'i32'