const A = error{ NotDir, /// A doc comment PathNotFound, }; const B = error{ OutOfMemory, /// B doc comment PathNotFound, }; const C = A || B; fn foo() C!void { return error.NotDir; } test "merge error sets" { if (foo()) { @panic("unexpected"); } else |err| switch (err) { error.OutOfMemory => @panic("unexpected"), error.PathNotFound => @panic("unexpected"), error.NotDir => {}, } } // test