return GW_OK;
}
+ANN static m_bool tmpl_rettype(const Emitter emit, const Func_Def func_def) {
+ CHECK_BB(template_push_types(emit->env, func_def->base->tmpl))
+ const m_bool ret = emit_parent_inner(emit, func_def->base->ret_type->e->def);
+ nspc_pop_type(emit->gwion->mp, emit->env->curr);
+ return ret;
+}
+
ANN static m_bool emit_func_def(const Emitter emit, const Func_Def func_def) {
const Func func = get_func(emit->env, func_def);
const Func former = emit->env->func;
UNSET_FLAG(func_def, template);
return GW_OK;
}
+ if(GET_FLAG(func_def->base->ret_type, template) && !GET_FLAG(func_def->base->ret_type, emit))
+ CHECK_BB(tmpl_rettype(emit, func_def))
if(SAFE_FLAG(emit->env->class_def, builtin) && GET_FLAG(emit->env->class_def, template))
return GW_OK;
if(!emit->env->class_def && !GET_FLAG(func_def, global) && !func_def->base->tmpl && !emit->env->scope->depth)
ANN static m_bool scan1_stmt(const Env env, Stmt stmt);
ANN static Type void_type(const Env env, const Type_Decl* td) {
+// could be more precise
+ if(SAFE_FLAG(env->class_def, template) && td->types)
+ return t_undefined;
const Type t = known_type(env, td);
CHECK_OO(t)
if(t->size)
SET_FLAG(a->base.type, dtor);
ADD_REF(t->nspc->dtor)
}
- nspc_add_type(t->e->owner, insert_symbol(a->base.type->name), a->base.type);
+// nspc_add_type(t->e->owner, insert_symbol(a->base.type->name), a->base.type);
+ map_set(&t->e->owner->info->type->map, insert_symbol(a->base.type->name), a->base.type);
return a->base.type;
} else if(type->types)
ERR_O(type->xid->pos,