2017-01-05 00:57:48 -08:00
|
|
|
const assert = @import("std").debug.assert;
|
|
|
|
|
2016-12-30 15:34:05 -08:00
|
|
|
fn foo(id: u64) -> %i32 {
|
|
|
|
return switch (id) {
|
|
|
|
1 => getErrInt(),
|
|
|
|
2 => {
|
2018-01-07 13:51:46 -08:00
|
|
|
const size = try getErrInt();
|
|
|
|
return try getErrInt();
|
2016-12-30 15:34:05 -08:00
|
|
|
},
|
|
|
|
else => error.ItBroke,
|
2017-12-21 21:50:30 -08:00
|
|
|
};
|
2016-12-30 15:34:05 -08:00
|
|
|
}
|
|
|
|
|
2017-12-21 21:50:30 -08:00
|
|
|
fn getErrInt() -> %i32 { return 0; }
|
2016-12-30 15:34:05 -08:00
|
|
|
|
|
|
|
error ItBroke;
|
|
|
|
|
2017-05-23 18:38:31 -07:00
|
|
|
test "ir block deps" {
|
2016-12-30 15:34:05 -08:00
|
|
|
assert(%%foo(1) == 0);
|
|
|
|
assert(%%foo(2) == 0);
|
|
|
|
}
|