zig/test/cases/compile_errors/offsetOf-bad_field_name.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

17 lines
260 B
Zig

const Foo = struct {
derp: i32,
};
export fn foo() usize {
return @offsetOf(
Foo,
"a",
);
}
// error
// backend=stage2
// target=native
//
// :7:9: error: no field named 'a' in struct 'tmp.Foo'
// :1:13: note: struct declared here