From: Jérémie Astor Date: Wed, 6 May 2020 16:34:37 +0000 (+0200) Subject: :art: Fix ref problem X-Git-Tag: nightly~1652 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8b00fb631801aaadd00708718801eaee9ba3d7ec;p=gwion.git :art: Fix ref problem --- diff --git a/src/parse/scan1.c b/src/parse/scan1.c index c83fa680..f7bbf02c 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -12,7 +12,7 @@ ANN static m_bool scan1_stmt(const Env env, Stmt stmt); ANN static m_bool type_recursive(const Env env, const Type_Decl *td, const Type t) { if(env->class_def && !env->scope->depth) { const m_int idx = vector_find(&env->scope->class_stack, (vtype)t); - if(idx > -1 || t == env->class_def) + if(!GET_FLAG(td, ref) && (idx > -1 || t == env->class_def)) ERR_B(td_pos(td), _("%s declared inside %s\n. (make it a ref ?)"), t->name, t == env->class_def ? "itself" : env->class_def->name); }