mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
fix bug on empty error union
This commit is contained in:
parent
8e3370367b
commit
4e28d7a5f7
@ -8128,7 +8128,6 @@ static ZigType *get_error_set_union(CodeGen *g, ErrorTableEntry **errors, ZigTyp
|
||||
}
|
||||
}
|
||||
assert(index == count);
|
||||
assert(count != 0);
|
||||
|
||||
if (type_name == nullptr) {
|
||||
buf_appendf(&err_set_type->name, "}");
|
||||
|
||||
@ -160,6 +160,10 @@ fn testErrToIntWithOnePossibleValue(
|
||||
}
|
||||
}
|
||||
|
||||
test "empty error union" {
|
||||
const x = error{} || error{};
|
||||
}
|
||||
|
||||
test "error union peer type resolution" {
|
||||
testErrorUnionPeerTypeResolution(1);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user