]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix ctor with arrays
authorJérémie Astor <fennecdjay@gmail.com>
Sat, 15 May 2021 01:47:43 +0000 (03:47 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Sat, 15 May 2021 01:47:43 +0000 (03:47 +0200)
src/lib/array.c
src/parse/check.c

index 0a2164cfbb5e602a52cb0b4b7b385265bb4ad9f0..ba9a5e61b2729424486bca5fc8eef88033c47ce9 100644 (file)
@@ -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;
 }
 
index 6de80a08c011d56a4fcb72bf6153963717e7fb40..be09cde9ca34455110a58bde057ef5e485e4c4ff 100644 (file)
@@ -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