ERR_O(exp_self(prim)->pos, _("keyword 'this' can be used only inside class definition..."))
if(env->func && !vflag(env->func->value_ref, vflag_member))
ERR_O(exp_self(prim)->pos, _("keyword 'this' cannot be used inside static functions..."))
- if(env->func && !strcmp(s_name(env->func->def->base->xid), "@gack"))
+ if(!exp_getuse(exp_self(prim)) && env->func && !strcmp(s_name(env->func->def->base->xid), "@gack"))
return get_gack(env->class_def->info->parent); // get_gack ?
return env->class_def;
}
const Value v = exp->d.prim.value;
const m_str name = !GET_FLAG(v, static) ? "this" : v->from->owner_class->name;
const Exp base = new_prim_id(env->gwion->mp, insert_symbol(name), prim_pos(data));
+ exp_setuse(base, 1);
exp->exp_type = ae_exp_dot;
exp->d.exp_dot.base = base;
exp->d.exp_dot.xid = *data;