diff --git a/src/ir.cpp b/src/ir.cpp index d50229925cc4d9e5ce31fe8f266d097963c92553..7bca551852d8bf6b622745735fe97e98251d4446 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 8ee1b3090782a77b255c4746db00de2bb144c963..9b7904e9cf6c7d5e87cde5f74d5a480c8fd0f79c 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); }