From bc44a91dc5f8dc18574987f0e43430b8c833a02a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 4 Jul 2021 14:53:13 +0200 Subject: [PATCH] :art: Prohibit @dtor in struct [Fix2] --- src/parse/scan1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/parse/scan1.c b/src/parse/scan1.c index cf227330..6d6a6f8b 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -593,9 +593,7 @@ ANN static inline m_bool scan_internal_int(const Env env, ANN static m_bool scan_internal(const Env env, const Func_Base *base) { const Symbol op = base->xid; if (op == insert_symbol("@dtor")) { - if(!env->class_def) - ERR_B(base->pos, "'@dtor' must be use in a class"); - if(tflag(env->class_def, tflag_struct)) + if(safe_tflag(env->class_def, tflag_struct)) ERR_B(base->pos, "can't use '@dtor' for structures"); return class_internal(env, base); } -- 2.43.0