]> Nishi Git Mirror - gwion.git/commitdiff
:art: check.c coverage
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 1 Sep 2019 22:58:35 +0000 (00:58 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 1 Sep 2019 22:58:35 +0000 (00:58 +0200)
src/parse/check.c
tests/error/call_non_template.gw [new file with mode: 0644]

index 35b17ccd25dfc886b16478c35f987f02064fdfbf..9b523c7e7fb063d1507c191fb31e9eaf398d18d8 100644 (file)
@@ -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 (file)
index 0000000..ea998b0
--- /dev/null
@@ -0,0 +1,3 @@
+#! [contains] template call of non-template function
+fun void test(){}
+test<~int~>();