Open2
Zigの知らなかった機能
Destructuring assignment みたいなやつ
fn hoge() struct { u64, u64 } {
return .{ 1, 2 };
}
const a, const b = hoge();
Error Union の OR
const SomeError = error{ ErrorOne, ErrorTwo };
const SomeType = struct {
const Error = error{ErrorThree};
};
inline fn hoge(s: anytype) (SomeError || @TypeOf(s).Error || error{ErrorFive})!void {
return;
}
try hoge(SomeType{});