mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
add compile error test case
This commit is contained in:
parent
dca4c302dd
commit
7666d5fc26
@ -0,0 +1,16 @@
|
||||
export fn entry() void {
|
||||
_ = foo() catch {};
|
||||
}
|
||||
fn foo() anyerror![4]u32 {
|
||||
return bar();
|
||||
}
|
||||
fn bar() anyerror!@Vector(4, u32) {
|
||||
return .{ 1, 2, 3, 4 };
|
||||
}
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :5:15: error: expected type 'anyerror![4]u32', found 'anyerror!@Vector(4, u32)'
|
||||
// :5:15: note: error union payload '@Vector(4, u32)' cannot cast into error union payload '[4]u32'
|
||||
// :4:18: note: function return type declared here
|
||||
Loading…
x
Reference in New Issue
Block a user