zig/test/cases/compile_errors/offsetOf-non_struct.zig
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00

10 lines
174 B
Zig

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