authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-07 23:03:06-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-07 23:03:06-07:00
log7666d5fc2653023670f6e61b6d19b0ba15750d67
treec99a4d2366532e5937ca7f944eb0008601a4edce
parentdca4c302dd323f093c53b354ad64d504ed7a2dea

add compile error test case


1 files changed, 16 insertions(+), 0 deletions(-)

test/cases/compile_errors/in_memory_coerce_vector_to_array.zig created+16
...@@ -0,0 +1,16 @@
1export fn entry() void {
2 _ = foo() catch {};
3}
4fn foo() anyerror![4]u32 {
5 return bar();
6}
7fn bar() anyerror!@Vector(4, u32) {
8 return .{ 1, 2, 3, 4 };
9}
10// error
11// backend=stage2
12// target=native
13//
14// :5:15: error: expected type 'anyerror![4]u32', found 'anyerror!@Vector(4, u32)'
15// :5:15: note: error union payload '@Vector(4, u32)' cannot cast into error union payload '[4]u32'
16// :4:18: note: function return type declared here