ANN m_bool emit_exp_call1(const Emitter emit, const Func f) {
if(!f->code || (GET_FLAG(f, ref) && !GET_FLAG(f, builtin))) {
- if(GET_FLAG(f, template) && emit->env->func != f && !is_fptr(f->value_ref->type))
- CHECK_BB(emit_template_code(emit, f))
+ if(GET_FLAG(f, template) && !is_fptr(f->value_ref->type)) {
+ if(emit->env->func != f)
+ CHECK_BB(emit_template_code(emit, f))
+ else {
+ const Instr back = (Instr)vector_back(&emit->code->instr);
+ back->opcode = ePushStaticCode;
+ }
+ }
} else if((f->value_ref->owner_class && is_special(f->value_ref->owner_class) > 0) ||
!f->value_ref->owner_class || (GET_FLAG(f, template) &&
isa(f->value_ref->type, t_fptr) < 0))
CHECK_BO(check_call(env, exp))
const Type_List types = exp->tmpl->call;
Func m_func = NULL, former = env->func;
- const m_str tmpl_name = tl2str(env, types);
+ DECL_OO(const m_str, tmpl_name, = tl2str(env, types))
const m_uint scope = env_push(env, v->owner_class, v->owner);
if(is_fptr(v->type)) {
const Symbol sym = func_symbol(env, v->owner->name, v->name, tmpl_name, 0);
return a->base.type;
} else if(type->types) { // TODO: clean me
if(isa(t, t_function) > 0 && t->e->d.func->def->base->tmpl) {
- const m_str tl_name = tl2str(env, type->types);
+ DECL_OO(const m_str, tl_name, = tl2str(env, type->types))
+// err_msg here ?
const Symbol sym = func_symbol(env, t->e->owner->name, t->e->d.func->name, tl_name, 0);
free_mstr(env->gwion->mp, tl_name);
const Type base_type = nspc_lookup_type1(t->e->owner, sym);