else if (unlikely(!f->code && emit->env->func != f)) {
if (tmpl) CHECK_BB(emit_template_code(emit, f));
else CHECK_BB(emit_ensure_func(emit, f));
- } else {
- if(!f->value_ref->from->owner_class ||
+ } else if(!f->value_ref->from->owner_class ||
GET_FLAG(f->value_ref->from->owner_class, final) ||
- GET_FLAG(f->value_ref->from->owner_class, static))
+ GET_FLAG(f, static) || tmpl)
push_func_code(emit, f);
- }
call_finish(emit, f, is_static);
emit->status = status;
return GW_OK;
CHECK_BB(emit_exp(emit, member->base));
if (is_func(emit->gwion, exp_self(member)->type)) { // is_callable? can only be a func
const Instr instr = emit_add_instr(emit, RegPushImm);
- const Func f =
- (Func)vector_front(&member->base->type->info->parent->nspc->vtable);
- instr->m_val = (m_uint)f->code;
+ instr->m_val = (m_uint)exp_self(member)->type->info->func->code;
return GW_OK;
}
if (!strcmp(s_name(member->xid), "index")) {
.op = insert_symbol(gwi->gwion->st, "@func_check")};
CHECK_BB(add_op(gwi->gwion, &opi1));
-builtin_func(gwi->gwion->mp, f1, union_new);
gwi->gwion->type[et_union] = t_union;
GWI_BB(gwi_oper_ini(gwi, "union", (m_str)OP_ANY_TYPE, NULL))