From 0358ac86db543de3ab38e282630c36244686fa2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 15 Mar 2021 01:29:12 +0100 Subject: [PATCH] :art: *Improve did you mean* --- src/parse/check.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index d2545a03..d2e479c9 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -253,8 +253,8 @@ ANN static Type check_dot(const Env env, const Exp_Dot *member) { return op_check(env, &opi); } -static inline Nspc value_owner(const Value v) { - return v ? v->from->owner : NULL; +static inline Nspc value_owner(const Env env, const Value v) { + return v ? v->from->owner : env->curr; } ANN static void check_upvalue(const Env env, const Exp_Primary *prim) { @@ -291,8 +291,7 @@ ANN static Type prim_id_non_res(const Env env, const Symbol *data) { if(!v || !vflag(v, vflag_valid) || (v->from->ctx && v->from->ctx->error)) { env_err(env, prim_pos(data), _("variable %s not legit at this point."), s_name(sym)); - if(v) - did_you_mean_nspc(value_owner(v) ?: env->curr, s_name(sym)); + did_you_mean_nspc(v ? value_owner(env, v) : env->curr, s_name(sym)); return NULL; } prim_self(data)->value = v; -- 2.43.0