]> Nishi Git Mirror - gwion.git/commitdiff
:art: Can't new abstract types
authorfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 7 Oct 2019 23:56:31 +0000 (01:56 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 7 Oct 2019 23:56:31 +0000 (01:56 +0200)
src/lib/opfunc.c

index 30f691922b48ba3fc8af7997dfc00dc71cca5bfe..0765b0b4a6eba6ba6866e3f78660be34f49ea4a9 100644 (file)
@@ -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))