small fixes

* error for '_' prong on exhaustive enum
* todo panic for `@tagName`  on non-exhaustive enum
* don't require '_' field on tagged unions
This commit is contained in:
Vexu
2020-01-15 22:09:19 +02:00
parent c57784aa15
commit 5c2238fc4a
3 changed files with 10 additions and 2 deletions

View File

@@ -5065,6 +5065,8 @@ static LLVMValueRef ir_render_enum_tag_name(CodeGen *g, IrExecutable *executable
{
ZigType *enum_type = instruction->target->value->type;
assert(enum_type->id == ZigTypeIdEnum);
if (enum_type->data.enumeration.non_exhaustive)
zig_panic("TODO @tagName on non-exhaustive enum");
LLVMValueRef enum_name_function = get_enum_tag_name_function(g, enum_type);