Skip to content

Commit

Permalink
🎨 Improve fptr decl checking
Browse files Browse the repository at this point in the history
  • Loading branch information
fennecdjay committed Dec 15, 2019
1 parent 7c47757 commit 2b9a353
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/parse/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2b9a353

Please sign in to comment.