diff options
| author | Vexu <git@vexu.eu> | 2020-01-15 22:09:19 +0200 |
|---|---|---|
| committer | Vexu <git@vexu.eu> | 2020-01-15 22:09:19 +0200 |
| commit | 5c2238fc4ad1d10f0620c931d369005b53742eb7 (patch) | |
| tree | 220fce9b5d4607c5c1c15994b50f1c3d37e54cc2 /src/analyze.cpp | |
| parent | c57784aa15b50a9f38482154170924babab19c03 (diff) | |
| download | zig-5c2238fc4ad1d10f0620c931d369005b53742eb7.tar.gz zig-5c2238fc4ad1d10f0620c931d369005b53742eb7.zip | |
small fixes
* error for '_' prong on exhaustive enum
* todo panic for `@tagName` on non-exhaustive enum
* don't require '_' field on tagged unions
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 0b2b6ddeaa..7669e0890b 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -3293,7 +3293,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) { } else if (enum_type_node != nullptr) { for (uint32_t i = 0; i < tag_type->data.enumeration.src_field_count; i += 1) { TypeEnumField *enum_field = &tag_type->data.enumeration.fields[i]; - if (!covered_enum_fields[i]) { + if (!covered_enum_fields[i] && !buf_eql_str(enum_field->name, "_")) { AstNode *enum_decl_node = tag_type->data.enumeration.decl_node; AstNode *field_node = enum_decl_node->data.container_decl.fields.at(i); ErrorMsg *msg = add_node_error(g, decl_node, |
