From: Jérémie Astor Date: Thu, 10 Sep 2020 21:09:54 +0000 (+0200) Subject: :art: Clear `func_type` X-Git-Tag: nightly~1353 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=876ac0a2617ec8137b8159c48b68ad7a35a44e0b;p=gwion.git :art: Clear `func_type` --- 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;