ANN static Type check_exp_call(const Env env, Exp_Call* exp);
-ANN static Func call2ufcc(const Env env, Exp_Call* call, const Value v) {
+ANN static Func call2ufcs(const Env env, Exp_Call* call, const Value v) {
const Exp this = call->func->d.exp_dot.base;
this->next = call->args;
call->args = this;
return call->func->type->info->func;
}
-ANN Func ufcc(const Env env, const Func up, Exp_Call *const call) {
+ANN Func ufcs(const Env env, const Func up, Exp_Call *const call) {
const Value v = nspc_lookup_value1(env->curr, up->def->base->xid);
if(v && isa(v->type, env->gwion->type[et_function]) > 0 && !vflag(v, vflag_member))
- return call2ufcc(env, call, v);
+ return call2ufcs(env, call, v);
return NULL;
}
(func = find_func_match_actual(env, up, args, 1, 0)))
return func;
return call->func->exp_type == ae_exp_dot && up->value_ref->from->owner_class ?
- ufcc(env, up, call) : NULL;
+ ufcs(env, up, call) : NULL;
}
ANN m_bool check_traverse_fdef(const Env env, const Func_Def fdef) {
}
ANN2(1) static void function_alternative(const Env env, const Type f, const Exp args, const loc_t pos){
+ if(env->context->error) // needed for ufcs
+ return;
env_err(env, pos, _("argument type(s) do not match for function. should be :"));
Func up = f->info->func;
do {
exp->func->exp_type == ae_exp_dot && !t->info->owner_class) {
if(exp->args)
CHECK_OB(check_exp(env, exp->args))
- const Func f = call2ufcc(env, exp, t->info->func->value_ref);
- if(f)
- return GW_OK;
+ return call2ufcs(env, exp, t->info->func->value_ref) ?
+ GW_OK: GW_ERROR;
}
const Exp e = exp_self(exp);
struct Op_Import opi = { .op=insert_symbol("@func_check"),