From: Jérémie Astor Date: Sat, 29 May 2021 12:29:24 +0000 (+0200) Subject: :bug: Improve has_traits X-Git-Tag: nightly~619^2~1 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=6c3d5883273946a5b500f23dcda042592bc4bfc8;p=gwion.git :bug: Improve has_traits --- diff --git a/src/parse/func_resolve_tmpl.c b/src/parse/func_resolve_tmpl.c index 52b74fa0..12c1b3e4 100644 --- a/src/parse/func_resolve_tmpl.c +++ b/src/parse/func_resolve_tmpl.c @@ -157,7 +157,8 @@ ANN static inline bool has_trait(const Type t, const Symbol trait) { return false; } -ANN static inline bool has_traits(const Type t, ID_List traits) { +ANN static inline bool has_traits(const Type t, const Specialized_List sl) { + ID_List traits = sl->traits; while(traits) { if(!has_trait(t, traits->xid)) return false; @@ -172,7 +173,7 @@ ANN static Func _find_template_match(const Env env, const Value v, Exp_Call *con Specialized_List sl = f->def->base->tmpl->list; while(tl) { DECL_OO(const Type, t, = known_type(env, tl->td)); - if(!has_traits(t, sl->traits)) + if(!has_traits(t, sl)) return NULL; tl = tl->next; }