]> Nishi Git Mirror - gwion.git/commitdiff
:art: Update
authorJérémie Astor <fennecdjay@gmail.com>
Tue, 30 Mar 2021 18:13:20 +0000 (20:13 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Tue, 30 Mar 2021 18:13:20 +0000 (20:13 +0200)
plug
src/env/type.c
src/lib/ref.c

diff --git a/plug b/plug
index 9a15fdc1f9a07e05576dbbe8f09cb6218e517781..12374dd4d90304931b66ba0fc89b1e74ee793d8e 160000 (submodule)
--- a/plug
+++ b/plug
@@ -1 +1 @@
-Subproject commit 9a15fdc1f9a07e05576dbbe8f09cb6218e517781
+Subproject commit 12374dd4d90304931b66ba0fc89b1e74ee793d8e
index 972937f984d8fd7b827172380c4f91008699c19d..4611b4ff34992a7f3504d0f8cc6ae2c18f93e159 100644 (file)
@@ -40,12 +40,12 @@ Type new_type(MemPool p, const m_str name, const Type parent) {
 }
 
 ANN Type type_copy(MemPool p, const Type type) {
-  const Type a = new_type(p, type->name, type->info->parent);
-  a->nspc           = type->nspc;
+  const Type a         = new_type(p, type->name, type->info->parent);
+  a->nspc              = type->nspc;
   a->info->owner       = type->info->owner;
   a->info->owner_class = type->info->owner_class;
-  a->size           = type->size;
-  a->array_depth    = type->array_depth;
+  a->size              = type->size;
+  a->array_depth       = type->array_depth;
   a->info->gack        = type->info->gack;
   return a;
 }
index 71c15c7c6b256f295e479fa60a19c8ac8ddab50e..cf0149a6700b272b4f7d42023e2866bb1ff29670 100644 (file)
@@ -61,12 +61,17 @@ OP_CHECK(opck_foreach_scan) {
     return exists != env->gwion->type[et_error] ? exists : NULL;
   const Type base = known_type(env, ts->td->types->td);
   const Type t = new_type(env->gwion->mp, s_name(info.name), base);
+  t->info->owner = base->info->owner;
+  t->info->owner_class = base->info->owner_class;
+  t->info->ctx = base->info->ctx;
   SET_FLAG(t, abstract | ae_flag_final);
   set_tflag(t, tflag_infer);
   const m_uint scope = env_push(env, base->info->owner_class, base->info->owner);
+//  mk_class(env, t, (loc_t){});
   base2ref(env, base, t);
   ref2base(env, t, base);
   env_pop(env, scope);
+  nspc_add_type_front(t->info->owner, info.name, t);
   return t;
 }