From 3c56047fa0a4e234a1304948cc1122fd234e6c30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 15 May 2021 03:47:43 +0200 Subject: [PATCH] :bug: Fix ctor with arrays --- src/lib/array.c | 1 - src/parse/check.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/array.c b/src/lib/array.c index 0a2164cf..ba9a5e61 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -691,7 +691,6 @@ static OP_CHECK(opck_array_scan) { t->nspc->dtor->native_func = (m_uint) (!tflag(base, tflag_struct) ? array_dtor_obj : array_dtor_struct); } - unset_tflag(t, tflag_ctor); return t; } diff --git a/src/parse/check.c b/src/parse/check.c index 6de80a08..be09cde9 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1600,7 +1600,10 @@ ANN static bool class_def_has_body(Ast ast) { continue; Var_Decl_List dlist = exp->d.exp_decl.list; do { - if(tflag(dlist->self->value->type, tflag_ctor)) + if(GET_FLAG(dlist->self->value, late)) + continue; + if(tflag(dlist->self->value->type, tflag_ctor) || + dlist->self->value->type->array_depth) return true; } while((dlist = dlist->next)); } else -- 2.43.0