aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/coerce_anon_struct.zig
blob: 84e3c732c80218e3b85d8ce236cb051a293c12a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
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_159'
// :3:16: note: struct declared here
// :1:11: note: struct declared here