From 6c3d5883273946a5b500f23dcda042592bc4bfc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 29 May 2021 14:29:24 +0200 Subject: [PATCH] :bug: Improve has_traits --- src/parse/func_resolve_tmpl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.43.0