#include "gwion.h"
ANN static inline m_bool freeable(const Type a) {
- return !GET_FLAG(a, nonnull) && GET_FLAG(a, template);
+ return !GET_FLAG(a, nonnull) &&
+ (GET_FLAG(a, template) || GET_FLAG(a, global));
}
ANN static void free_type(Type a, Gwion gwion) {
if(GET_FLAG(cdef, global))
env->curr = (Nspc)vector_pop(&env->scope->nspc_stack);
CHECK_BB(ret)
- if(cdef->base.tmpl && !cdef->base.tmpl->call) {
+ if(GET_FLAG(cdef, global) || (cdef->base.tmpl && !cdef->base.tmpl->call)) {
const Class_Def c = cpy_class_def(env->gwion->mp, cdef);
c->base.type = cdef->base.type;
c->base.type->e->def = c;