Commit 4e28d7a5f7

daurnimator <quae@daurnimator.com>
2019-11-16 16:46:44
fix bug on empty error union
1 parent 8e33703
Changed files (2)
src
test
stage1
behavior
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, "}");
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);
 }