From 77d12b0cbe88155f36b6a3ced63cc73ca91a495a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 17 Mar 2022 12:42:14 +0100 Subject: [PATCH] :art: small template fix --- src/lib/object_op.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/object_op.c b/src/lib/object_op.c index e511e46d..b704b764 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -73,6 +73,7 @@ ANN /*static*/ Type scan_class(const Env env, const Type t, static OP_CHECK(opck_struct_scan) { struct TemplateScan *ts = (struct TemplateScan *)data; + if(ts->t->info->cdef->base.tmpl->call) return ts->t; return scan_class(env, ts->t, ts->td) ?: env->gwion->type[et_error]; } @@ -340,7 +341,7 @@ ANN bool tmpl_global(const Env env, Type_List tl) { ANN Type scan_class(const Env env, const Type t, const Type_Decl *td) { struct tmpl_info info = { .base = t, .td = td, .list = t->info->cdef->base.tmpl->list}; - const Type exists = t->info->cdef->base.tmpl->call ? t : tmpl_exists(env, &info); + const Type exists = tmpl_exists(env, &info); if (exists) return exists != env->gwion->type[et_error] ? exists : NULL; struct EnvSet es = {.env = env, .data = env, -- 2.43.0