From: Jérémie Astor Date: Tue, 7 Jul 2020 17:49:04 +0000 (+0200) Subject: :art: Enforce use of globals variables in global classes X-Git-Tag: nightly~1445 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9f86c05439b291ada8e488824882a2e5147b3ac2;p=gwion.git :art: Enforce use of globals variables in global classes --- 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; }