From: Jérémie Astor Date: Sat, 15 Aug 2020 15:01:00 +0000 (+0200) Subject: :art: Improve scan_type X-Git-Tag: nightly~1370 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e0af6b53d75f558f7c9344901bb480a2d18d94dd;p=gwion.git :art: Improve scan_type --- diff --git a/src/parse/template.c b/src/parse/template.c index ec8b8180..857cf8ad 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -92,7 +92,7 @@ static ANN Type maybe_func(const Env env, const Type t, const Type_Decl* td) { _("type '%s' is not template. You should not provide template types"), t->name) } -ANN Type _scan_type(const Env env, const Type t, const Type_Decl* td) { +ANN Type _scan_type(const Env env, const Type t, Type_Decl* td) { if(GET_FLAG(t, template)) { if(GET_FLAG(t, ref) || (GET_FLAG(t, unary) && !td->types)) return t; @@ -101,7 +101,11 @@ ANN Type _scan_type(const Env env, const Type t, const Type_Decl* td) { return op_check(env, &opi); } else if(td->types) return maybe_func(env, t, td); - return td->xid ? nspc_lookup_type1(env->curr, td->xid) : t; + Type_Decl *next = td->next; + td->next = NULL; + const Type ret = find_type(env, td); + td->next = next; + return ret; } ANN Type scan_type(const Env env, const Type t, Type_Decl* td) {