aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2020-01-15 22:09:19 +0200
committerVexu <git@vexu.eu>2020-01-15 22:09:19 +0200
commit5c2238fc4ad1d10f0620c931d369005b53742eb7 (patch)
tree220fce9b5d4607c5c1c15994b50f1c3d37e54cc2 /src/codegen.cpp
parentc57784aa15b50a9f38482154170924babab19c03 (diff)
downloadzig-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/codegen.cpp')
-rw-r--r--src/codegen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 0dc820be51..42fd188824 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -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);