aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2020-01-16 09:04:11 +0200
committerVexu <git@vexu.eu>2020-01-16 09:04:11 +0200
commitd84569895c80136d9b081a319301a737f342d251 (patch)
tree1c054a3ba13f70b92143fbdc4c92f28e47a16eea /src/codegen.cpp
parent02e5cb1cd4203219ae753e94c7e14cd18a918b49 (diff)
downloadzig-d84569895c80136d9b081a319301a737f342d251.tar.gz
zig-d84569895c80136d9b081a319301a737f342d251.zip
turn panics into compile errors, require at least 1 field in non-exhaustive enum
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 42fd188824..030e892d45 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -5065,8 +5065,11 @@ 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");
+ if (enum_type->data.enumeration.non_exhaustive) {
+ add_node_error(g, instruction->base.source_node,
+ buf_sprintf("TODO @tagName on non-exhaustive enum https://github.com/ziglang/zig/issues/3991"));
+ codegen_report_errors_and_exit(g);
+ }
LLVMValueRef enum_name_function = get_enum_tag_name_function(g, enum_type);