From 4fc0b49c78d649721e34d127fbc5b471c1ec9448 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 8 Oct 2019 01:56:31 +0200 Subject: [PATCH] :art: Can't new abstract types --- src/lib/opfunc.c | 2 ++ 1 file changed, 2 insertions(+) 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)) -- 2.43.0