| author | |
| committer | |
| log | 7666d5fc2653023670f6e61b6d19b0ba15750d67 |
| tree | c99a4d2366532e5937ca7f944eb0008601a4edce |
| parent | dca4c302dd323f093c53b354ad64d504ed7a2dea |
1 files changed, 16 insertions(+), 0 deletions(-)
test/cases/compile_errors/in_memory_coerce_vector_to_array.zig created+16| ... | @@ -0,0 +1,16 @@ | ||
| 1 | export fn entry() void { | ||
| 2 | _ = foo() catch {}; | ||
| 3 | } | ||
| 4 | fn foo() anyerror![4]u32 { | ||
| 5 | return bar(); | ||
| 6 | } | ||
| 7 | fn 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 | ||