From: fennecdjay Date: Sat, 24 Aug 2019 10:52:57 +0000 (+0200) Subject: :bug: Fix func templates X-Git-Tag: nightly~2266 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=094ca6aecf8daf502bdcc2b208b42a9157e6e287;p=gwion.git :bug: Fix func templates --- diff --git a/src/parse/check.c b/src/parse/check.c index 8ad333fe..6a26a126 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -515,8 +515,6 @@ ANN static inline Value template_get_ready(const Env env, const Value v, const m } static Func ensure_tmpl(const Env env, const Func_Def fdef, const Exp_Call *exp) { - if(fdef->base->func) - return fdef->base->func; const m_bool ret = traverse_func_def(env, fdef); if(ret > 0) { const Func f = fdef->base->func; @@ -588,7 +586,7 @@ CHECK_BO(check_call(env, exp)) m_func = env->func; break; } - if((m_func = exists->d.func_ref)) + if((m_func = ensure_tmpl(env, exists->d.func_ref->def, exp))) break; } else { const Value value = template_get_ready(env, v, "template", i);