From 7b29aa553429899055c30821e98cf90a89224423 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 28 May 2021 11:54:28 +0200 Subject: [PATCH] :art: Few cleaning stuff --- src/parse/check.c | 4 ++-- src/parse/func_resolve_tmpl.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index 4f63a818..eb1e692e 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -314,7 +314,7 @@ ANN static Type prim_id_non_res(const Env env, const Symbol *data) { const Value v = check_non_res_value(env, data); if(!v || !vflag(v, vflag_valid) || (v->from->ctx && v->from->ctx->error)) { const m_str name = s_name(*data); - if(!isalpha(*name) && *name != '_') + if(!isalpha(*name) && *name != '_') /* && *name != '@' ???*/ return env->gwion->type[et_op]; gwerr_basic(_("Invalid variable"), _("not legit at this point."), NULL, env->name, prim_pos(data), 0); @@ -476,7 +476,7 @@ ANN2(1,2) static Func find_func_match_actual(const Env env, Func func, const Exp CHECK_OO(func->next); return find_func_match_actual(env, func->next, args, implicit, specific); } else if(!e->type) //fix bug found with Cytosol - return NULL; + return NULL; if(e1->type == env->gwion->type[et_auto] || (func->def->base->tmpl && is_fptr(env->gwion, func->value_ref->type) > 0)) { const Type owner = func->value_ref->from->owner_class; diff --git a/src/parse/func_resolve_tmpl.c b/src/parse/func_resolve_tmpl.c index d65376f3..4059908f 100644 --- a/src/parse/func_resolve_tmpl.c +++ b/src/parse/func_resolve_tmpl.c @@ -93,9 +93,7 @@ ANN static Func tmpl_exists(const Env env, struct ResolverArgs* ra, const Value } ANN static Func create_tmpl(const Env env, struct ResolverArgs* ra, const m_uint i) { - const Value value = template_get_ready(env, ra->v, "template", i); - if(!value) - return NULL; + DECL_OO(const Value, value, = template_get_ready(env, ra->v, "template", i)); const Func_Def fdef = (Func_Def)cpy_func_def(env->gwion->mp, value->d.func_ref->def); if(vflag(ra->v, vflag_builtin)) set_vflag(value, vflag_builtin); @@ -132,7 +130,7 @@ ANN static Func find_tmpl(const Env env, const Value v, Exp_Call *const exp, con if(v->from->owner_class && v->from->owner_class->info->cdef->base.tmpl) (void)template_push_types(env, v->from->owner_class->info->cdef->base.tmpl); const Func m_func = !is_fptr(env->gwion, v->type) ? - func_match(env, &ra) :fptr_match(env, &ra); + func_match(env, &ra) : fptr_match(env, &ra); if(v->from->owner_class && v->from->owner_class->info->cdef->base.tmpl) nspc_pop_type(env->gwion->mp, env->curr); env_pop(env, scope); -- 2.43.0