aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-11-29 22:50:08 +0000
committergingerBill <bill@gingerbill.org>2018-11-29 22:50:08 +0000
commit008d8f25c824d45096dfc23d1c741dba7babdff4 (patch)
tree477e85fab6436cf96e356eaaef207a0f2c4b2448 /src/ir.cpp
parent7ffcf34dca571979b0cdf4eab386a023cb5ff147 (diff)
Fix assertion on union assignment in compound literal
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index ad54b6213..bcbcc83d6 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7027,9 +7027,7 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) {
Type *fet = ir_type(field_expr);
// HACK TODO(bill): THIS IS A MASSIVE HACK!!!!
- if (is_type_union(ft) && !are_types_identical(fet, ft)) {
- GB_ASSERT(union_variant_index(ft, fet) > 0);
-
+ if (is_type_union(ft) && !are_types_identical(fet, ft) && !is_type_untyped(fet)) {
irValue *gep = ir_emit_struct_ep(proc, v, cast(i32)index);
ir_emit_store_union_variant(proc, gep, field_expr, fet);
} else {