From: fennecdjay Date: Sun, 1 Sep 2019 22:58:35 +0000 (+0200) Subject: :art: check.c coverage X-Git-Tag: nightly~2244 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=d4e6f18941c71886ec3f6ac55eb430096ffe4eeb;p=gwion.git :art: check.c coverage --- diff --git a/src/parse/check.c b/src/parse/check.c index 35b17ccd..9b523c7e 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -825,8 +825,7 @@ ANN static Type check_exp_call(const Env env, Exp_Call* exp) { CHECK_OO(check_exp(env, exp->func)) const Type t = actual_type(exp->func->type); const Value v = nspc_lookup_value1(t->e->owner, insert_symbol(t->name)); - if(!v) - ERR_O(exp_self(exp)->pos, _("template call of non-existant function.")) + assert(v); if(!GET_FLAG(v, func) && !GET_FLAG(exp->func->type, func)) ERR_O(exp_self(exp)->pos, _("template call of non-function value.")) if(!v->d.func_ref->def->base->tmpl) diff --git a/tests/error/call_non_template.gw b/tests/error/call_non_template.gw new file mode 100644 index 00000000..ea998b0f --- /dev/null +++ b/tests/error/call_non_template.gw @@ -0,0 +1,3 @@ +#! [contains] template call of non-template function +fun void test(){} +test<~int~>();