From: Jérémie Astor Date: Wed, 30 Dec 2020 21:57:08 +0000 (+0100) Subject: :art: Improve operator definition X-Git-Tag: nightly~1069 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=96224a7d8f940773dbd3c6d00fd90be0d51e24ee;p=gwion.git :art: Improve operator definition --- diff --git a/src/parse/check.c b/src/parse/check.c index f4985edc..8c62044e 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1202,7 +1202,10 @@ ANN static m_bool check_func_overload(const Env env, const Func_Def fdef) { const Func f1 = get_overload(env, fdef, i); for(m_uint j = i + 1; f1 && j <= v->from->offset; ++j) { const Func f2 = get_overload(env, fdef, j); - if(f2 && compat_func(f1->def, f2->def) > 0) + if(f2 && compat_func(f1->def, f2->def) > 0 && + fbflag(f1->def->base, fbflag_op) == fbflag(f2->def->base, fbflag_op) && + fbflag(f1->def->base, fbflag_unary) == fbflag(f2->def->base, fbflag_unary) && + fbflag(f1->def->base, fbflag_postfix) == fbflag(f2->def->base, fbflag_postfix)) ERR_B(f2->def->base->td->pos, _("global function '%s' already defined" " for those arguments"), s_name(fdef->base->xid)) }