From 309d95f926103e3f32fe8e4ecc79002fe5a89b6d Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 8 Aug 2019 16:13:04 +0200 Subject: [PATCH] :bug: FIx tuple members --- src/lib/tuple.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/lib/tuple.c b/src/lib/tuple.c index 7426d6eb..407fb120 100644 --- a/src/lib/tuple.c +++ b/src/lib/tuple.c @@ -182,25 +182,23 @@ static OP_EMIT(opem_at_tuple) { ANN void tuple_info(const Env env, Type_Decl *base, const Var_Decl var) { const Value v = var->value; - if(v->name[0] != '@') { - const m_uint offset = vector_back(&env->class_def->e->tuple_offset); - vector_add(&env->class_def->e->tuple_form, (vtype)v->type); - vector_add(&env->class_def->e->tuple_offset, offset + v->type->size); - Type_Decl *td = cpy_type_decl(env->gwion->mp, base); - if(var->array) { - if(td->array) - td->array->depth += var->array->depth; - else - td->array = cpy_array_sub(env->gwion->mp, var->array); - } - if(env->class_def->e->tuple_tl) { - Type_List tl = env->class_def->e->tuple_tl; - while(tl->next) - tl = tl->next; - tl->next = new_type_list(env->gwion->mp, td, NULL); - } else - env->class_def->e->tuple_tl = new_type_list(env->gwion->mp, td, NULL); + const m_uint offset = vector_back(&env->class_def->e->tuple_offset); + vector_add(&env->class_def->e->tuple_form, (vtype)v->type); + vector_add(&env->class_def->e->tuple_offset, offset + v->type->size); + Type_Decl *td = cpy_type_decl(env->gwion->mp, base); + if(var->array) { + if(td->array) + td->array->depth += var->array->depth; + else + td->array = cpy_array_sub(env->gwion->mp, var->array); } + if(env->class_def->e->tuple_tl) { + Type_List tl = env->class_def->e->tuple_tl; + while(tl->next) + tl = tl->next; + tl->next = new_type_list(env->gwion->mp, td, NULL); + } else + env->class_def->e->tuple_tl = new_type_list(env->gwion->mp, td, NULL); } INSTR(TupleCtor) { -- 2.43.0