From df55968f43fc39589875e62bd17783ce3d55a709 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 1 Oct 2019 22:57:03 +0200 Subject: [PATCH] :art: more on check_implicit --- src/parse/check.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index 27b12da7..17e34fbb 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -180,7 +180,8 @@ ANN static m_bool prim_array_inner(const Env env, Type type, const Exp e) { const Type common = find_common_anc(e->type, type); if(common) return GW_OK; - if(check_implicit(env, insert_symbol("@implicit"), e, type) < 0) + const Symbol sym = insert_symbol("@implicit"); + if(check_implicit(env, sym, e, type) < 0) ERR_B(e->pos, _("array init [...] contains incompatible types ...")) set_cast(env, type, e); // ??? return GW_OK; @@ -457,8 +458,10 @@ ANN static m_bool func_match_inner(const Env env, const Exp e, const Type t, insert_symbol(t->e->owner->name)); return check_lambda(env, owner, &e->d.exp_lambda, t->e->d.func->def); } - if(implicit) - return check_implicit(env, insert_symbol("@implicit"), e, t); + if(implicit) { + const Symbol sym = insert_symbol("@implicit"); + return check_implicit(env, sym, e, t); + } } return match ? 1 : -1; } -- 2.43.0