From: fennecdjay Date: Mon, 7 Oct 2019 23:56:31 +0000 (+0200) Subject: :art: Can't new abstract types X-Git-Tag: nightly~2198^2~119 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=4fc0b49c78d649721e34d127fbc5b471c1ec9448;p=gwion.git :art: Can't new abstract types --- diff --git a/src/lib/opfunc.c b/src/lib/opfunc.c index 30f69192..0765b0b4 100644 --- a/src/lib/opfunc.c +++ b/src/lib/opfunc.c @@ -98,6 +98,8 @@ OP_CHECK(opck_new) { ERR_N(exp_self(unary)->pos, _("primitive types cannot be used as reference (@)...\n")) if(type_ref(t)) ERR_N(td_pos(unary->td), _("can't use 'new' on ref type '%s'\n"), t->name) + if(GET_FLAG(t, abstract)) + ERR_N(td_pos(unary->td), _("can't use 'new' on abstract type '%s'\n"), t->name) UNSET_FLAG(unary->td, ref); if(unary->td->array) CHECK_BN(check_subscripts(env, unary->td->array))