From 2b9a3539c7c449b5f516248535f6e291da4b12fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 15 Dec 2019 12:53:18 +0100 Subject: [PATCH] :art: Improve fptr decl checking --- src/parse/check.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)) -- 2.43.0