From ef2fe44313b739aebf617dbb55ddb45507e4b180 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 13 Apr 2020 23:02:00 +0200 Subject: [PATCH] :art: Improve check_non_res_value --- src/parse/check.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index a2567d35..a15ad008 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -245,10 +245,10 @@ ANN static Value check_non_res_value(const Env env, const Symbol *data) { const Symbol var = *data; const Value value = nspc_lookup_value1(env->curr, var); if(env->class_def) { - const Value v = value ? value : find_value(env->class_def, var); + if(value && value->from->owner_class) + CHECK_BO(not_from_owner_class(env, env->class_def, value, prim_pos(data))) + const Value v = value ?: find_value(env->class_def, var); if(v) { - if(v->from->owner_class) - CHECK_BO(not_from_owner_class(env, env->class_def, v, prim_pos(data))) if(env->func && GET_FLAG(env->func->def, static) && GET_FLAG(v, member)) ERR_O(prim_pos(data), _("non-static member '%s' used from static function."), s_name(var)) -- 2.43.0