From: Jérémie Astor Date: Sun, 4 Jul 2021 12:53:13 +0000 (+0200) Subject: :art: Prohibit @dtor in struct [Fix2] X-Git-Tag: nightly~554 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=bc44a91dc5f8dc18574987f0e43430b8c833a02a;p=gwion.git :art: Prohibit @dtor in struct [Fix2] --- 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); }