diff --git a/src/ir.cpp b/src/ir.cpp index d50229925..7bca55185 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -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, "}"); diff --git a/test/stage1/behavior/error.zig b/test/stage1/behavior/error.zig index 8ee1b3090..9b7904e9c 100644 --- a/test/stage1/behavior/error.zig +++ b/test/stage1/behavior/error.zig @@ -160,6 +160,10 @@ fn testErrToIntWithOnePossibleValue( } } +test "empty error union" { + const x = error{} || error{}; +} + test "error union peer type resolution" { testErrorUnionPeerTypeResolution(1); }