aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 2d55000cc4..6f4ba6c58f 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -816,8 +816,12 @@ static LLVMValueRef gen_field_access_expr(CodeGen *g, AstNode *node, bool is_lva
}
} else if (struct_type->id == TypeTableEntryIdMetaType) {
assert(!is_lvalue);
- TypeTableEntry *enum_type = get_type_for_type_node(struct_expr);
- return gen_enum_value_expr(g, node, enum_type, nullptr);
+ TypeTableEntry *child_type = get_type_for_type_node(struct_expr);
+ if (child_type->id == TypeTableEntryIdEnum) {
+ return gen_enum_value_expr(g, node, child_type, nullptr);
+ } else {
+ zig_unreachable();
+ }
} else {
zig_unreachable();
}