From 9f86c05439b291ada8e488824882a2e5147b3ac2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 7 Jul 2020 19:49:04 +0200 Subject: [PATCH] :art: Enforce use of globals variables in global classes --- src/parse/check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index ed1a2ac1..ad2deb49 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -266,10 +266,10 @@ ANN static Value check_non_res_value(const Env env, const Symbol *data) { _("non-static member '%s' used from static function."), s_name(var)) } return v; - } else if(env->func && GET_FLAG(env->func->def, global)) { + } else if(SAFE_FLAG(env->class_def, global) || (env->func && GET_FLAG(env->func->def, global))) { if(!SAFE_FLAG(value, abstract)) ERR_O(prim_pos(data), - _("non-global variable '%s' used from global function."), s_name(var)) + _("non-global variable '%s' used from global function/class."), s_name(var)) } return value; } -- 2.43.0