}
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;
}
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;
}