This code compiles:
error.Foo catch {};
But not:
error.Foo catch |bar| {
std.debug.print("{s}", .{bar});
};
Why is that? Does catch
without capturing payload works with error too? I thought catch
only works with error union.
This code compiles:
error.Foo catch {};
But not:
error.Foo catch |bar| {
std.debug.print("{s}", .{bar});
};
Why is that? Does catch
without capturing payload works with error too? I thought catch
only works with error union.