aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/coerce_anon_struct.zig
blob: 5737f861f3c9da2cca3110790643fcada5b9616d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const A = struct { x: u32 };
const T = struct { x: u32 };
export fn foo() void {
    const a = A{ .x = 123 };
    _ = @as(T, a);
}

// error
//
// :5:16: error: expected type 'tmp.T', found 'tmp.A'
// :1:11: note: struct declared here
// :2:11: note: struct declared here