ANN m_bool is_fptr(const struct Gwion_*, const Type t);
ANN m_bool is_class(const struct Gwion_*, const Type t);
ANN m_uint get_depth(const Type type);
+ANN void inherit(const Type);
__attribute__((returns_nonnull))
ANN static inline Type get_gack(Type t) {
ANN Type actual_type(const struct Gwion_* gwion, const Type t) {
return is_class(gwion, t) ? t->e->d.base_type : t;
}
+
+ANN void inherit(const Type t) {
+ const Nspc nspc = t->nspc, parent = t->e->parent->nspc;
+ if(!nspc || !parent)
+ return;
+ nspc->info->offset = parent->info->offset;
+ if(parent->info->vtable.ptr)
+ vector_copy2(&parent->info->vtable, &nspc->info->vtable);
+}
return GW_OK;
}
-ANN void inherit(const Type t) {
- const Nspc nspc = t->nspc, parent = t->e->parent->nspc;
- if(!nspc || !parent)
- return;
- nspc->info->offset = parent->info->offset;
- if(parent->info->vtable.ptr)
- vector_copy2(&parent->info->vtable, &nspc->info->vtable);
-}
-
ANN2(1,2) static void import_class_ini(const Env env, const Type t) {
t->nspc = new_nspc(env->gwion->mp, t->name);
t->nspc->parent = env->curr;