From: Jérémie Astor Date: Sun, 15 Dec 2019 11:53:18 +0000 (+0100) Subject: :art: Improve fptr decl checking X-Git-Tag: nightly~1984 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2b9a3539c7c449b5f516248535f6e291da4b12fe;p=gwion.git :art: Improve fptr decl checking --- diff --git a/src/parse/check.c b/src/parse/check.c index 3e5b2aa2..6a2e44ff 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -68,7 +68,12 @@ describe_check_decl(static, class_data_size) ANN static m_bool check_fptr_decl(const Env env, const Var_Decl var) { const Value v = var->value; - const Func func = v->type->e->d.func; + Type t = v->type; + while(GET_FLAG(t, typedef)) + t = t->e->parent; + if(!t->e->d.func) + return GW_ERROR; + const Func func = t->e->d.func; const Type type = func->value_ref->from->owner_class; if(!env->class_def) { if(!type || GET_FLAG(func, global))