From: Jérémie Astor Date: Sun, 24 May 2020 22:07:15 +0000 (+0200) Subject: :art: Use typedef flag for pre-defined template function pointer X-Git-Tag: nightly~1517 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8acbfd0f19edbd8f51af4c4a823f83b2a5c3f8c1;p=gwion.git :art: Use typedef flag for pre-defined template function pointer --- diff --git a/src/parse/check.c b/src/parse/check.c index 5a701565..81b4d5ec 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -678,6 +678,7 @@ ANN static Type check_predefined(const Env env, Exp_Call *exp, const Value v, co .scope=scope, .flag=ae_flag_check }; CHECK_BO(envset_push(&es, v->from->owner_class, v->from->owner)) (void)env_push(env, v->from->owner_class, v->from->owner); + SET_FLAG(func->def, typedef); const m_bool ret = traverse_func_def(env, func->def); if(es.run) envset_pop(&es, v->from->owner_class); diff --git a/src/parse/scan2.c b/src/parse/scan2.c index be22079c..8b066b69 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -298,7 +298,7 @@ ANN static m_bool scan2_func_def_overload(const Env env, const Func_Def f, const const m_bool base = tmpl_base(f->base->tmpl); const m_bool tmpl = GET_FLAG(overload, template); if(isa(overload->type, env->gwion->type[et_function]) < 0 || is_fptr(env->gwion, overload->type)) { - if(isa(overload->type, env->gwion->type[et_class]) < 0) + if(!GET_FLAG(f, typedef)) ERR_B(f->pos, _("function name '%s' is already used by another value"), overload->name) } if((!tmpl && base) || (tmpl && !base && !GET_FLAG(f, template)))