From: Jérémie Astor Date: Sun, 4 Jul 2021 12:35:50 +0000 (+0200) Subject: :art: Prohibit @dtor in struct X-Git-Tag: nightly~556 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b9455f6baebdf14414064f09cd27c955a3a731e3;p=gwion.git :art: Prohibit @dtor in struct --- diff --git a/src/parse/scan1.c b/src/parse/scan1.c index be809612..c334d507 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -592,7 +592,12 @@ 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") || op == insert_symbol("@gack")) + if (op == insert_symbol("@dtor")) { + if(tflag(env->class_def, tflag_struct)) + ERR_B(base->pos, "can't use '@dtor' for structures"); + return class_internal(env, base); + } + if (op == insert_symbol("@gack")) return class_internal(env, base); if (op == insert_symbol("@implicit")) return scan_internal_arg(env, base); if (op == insert_symbol("@conditional") ||