aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-15 12:14:56 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-15 12:14:56 +0100
commit23f9f9064e99e559f57b35a5f84a9525f8023bd9 (patch)
tree6884a9ed6133485f38d78d0d3c3c359e6a5118cc /src/check_decl.cpp
parenta134307dcde9aac03323c15f8dfc5642f438fe56 (diff)
Add CheckerInfo API functions
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 4dff7a838..783d254a8 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -43,7 +43,11 @@ Type *check_init_variable(Checker *c, Entity *e, Operand *operand, String contex
if (is_type_bit_field_value(t)) {
t = default_bit_field_value_type(t);
}
-
+ if (is_type_variant(t)) {
+ Type *st = base_type(t);
+ GB_ASSERT(st->Record.variant_parent != NULL);
+ t = st->Record.variant_parent;
+ }
GB_ASSERT(is_type_typed(t));
e->type = t;
}