From d7b874fb6c15edd9731dac63ff1537dcbf441259 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 7 Jul 2020 19:19:36 +0200 Subject: [PATCH] :art: Simplify func_match_inner --- src/parse/check.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index 1650534b..ed1a2ac1 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -431,17 +431,14 @@ ANN static Type_List mk_type_list(const Env env, const Type type, const loc_t po ANN static m_bool func_match_inner(const Env env, const Exp e, const Type t, const m_bool implicit, const m_bool specific) { - const m_bool match = (specific ? e->info->type == t : isa(e->info->type, t) > 0) && - e->info->type->array_depth == t->array_depth && - array_base(e->info->type) == array_base(t); - if(!match) { - if(e->info->type == env->gwion->type[et_lambda] && is_fptr(env->gwion, t)) { - const m_bool ret = check_lambda(env, t, &e->d.exp_lambda); - exp_setvar(e, 1); - return ret; - } - if(implicit) - return check_implicit(env, e, t); + const m_bool match = (specific ? e->info->type == t : isa(e->info->type, t) > 0); + if(!match) { + if(e->info->type == env->gwion->type[et_lambda] && is_fptr(env->gwion, t)) { + exp_setvar(e, 1); + return check_lambda(env, t, &e->d.exp_lambda); + } + if(implicit) + return check_implicit(env, e, t); } return match ? 1 : -1; } -- 2.43.0