From 876ac0a2617ec8137b8159c48b68ad7a35a44e0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 10 Sep 2020 23:09:54 +0200 Subject: [PATCH] :art: Clear `func_type` --- src/parse/scan2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 5e2cf91f..de07d55b 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -318,9 +318,10 @@ ANN static Func scan_new_func(const Env env, const Func_Def f, const m_str name) } ANN static Type func_type(const Env env, const Func func) { - const Type t = type_copy(env->gwion->mp, env->gwion->type[func->def->base->td ? et_function : et_lambda]); + const Type base = env->gwion->type[func->def->base->td ? et_function : et_lambda]; + const Type t = type_copy(env->gwion->mp, base); t->xid = ++env->scope->type_xid; - t->e->parent = env->gwion->type[func->def->base->td ? et_function : et_lambda]; + t->e->parent = base; t->name = func->name; t->e->owner = env->curr; t->e->owner_class = env->class_def; -- 2.43.0