zig/test/cases/compile_errors/coerce_anon_struct.zig
Alex Rønne Petersen 999777e73a compiler: Scaffold stage2_powerpc backend.
Nothing interesting here; literally just the bare minimum so I can work on this
on and off in a branch without worrying about merge conflicts in the non-backend
code.
2025-05-20 10:23:16 +02:00

12 lines
257 B
Zig

const T = struct { x: u32 };
export fn foo() void {
const a = .{ .x = 123 };
_ = @as(T, a);
}
// error
//
// :4:16: error: expected type 'tmp.T', found 'tmp.foo__struct_466'
// :3:16: note: struct declared here
// :1:11: note: struct declared here