From: fennecdjay Date: Wed, 9 Oct 2019 20:31:47 +0000 (+0200) Subject: :art: template coverage X-Git-Tag: nightly~2198^2~56 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2f94e237e6a8f5049e8059a99aef1d79f6f56f91;p=gwion.git :art: template coverage --- diff --git a/src/parse/template.c b/src/parse/template.c index 3a60b285..04b7d1b0 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -105,8 +105,7 @@ ANN m_bool template_push_types(const Env env, const Tmpl *tmpl) { if(!call) break; const Type t = known_type(env, call->td); - if(!t) - POP_RET(-1); + assert(t); // was if(!t)POP_RET(-1); nspc_add_type(env->curr, list->xid, t); call = call->next; } while((list = list->next)); diff --git a/tests/tree/template_class_invalid_type_number.gw b/tests/tree/template_class_invalid_type_number.gw new file mode 100644 index 00000000..00ee4972 --- /dev/null +++ b/tests/tree/template_class_invalid_type_number.gw @@ -0,0 +1,2 @@ +class <~A~>C {} +<~int, float~>C c; diff --git a/tests/tree/template_self.gw b/tests/tree/template_self.gw new file mode 100644 index 00000000..eb852ddc --- /dev/null +++ b/tests/tree/template_self.gw @@ -0,0 +1,7 @@ +class <~A~>C { + fun void test() { + <~A~>C c; + } +} + +<~int~>C c;