From e1ffc328de1798f848200dfd14c3c975fb6e6658 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 9 Aug 2022 04:17:08 +0200 Subject: [PATCH] :art: Clean --- src/lib/opfunc.c | 2 +- src/parse/check.c | 1 - src/parse/scan1.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/opfunc.c b/src/lib/opfunc.c index 50cb17ef..ab43adcd 100644 --- a/src/lib/opfunc.c +++ b/src/lib/opfunc.c @@ -118,7 +118,7 @@ OP_CHECK(opck_new) { Exp_Unary *unary = (Exp_Unary *)data; const Array_Sub array = unary->ctor.td->array; DECL_ON(const Type, t, = known_type(env, unary->ctor.td)); - if(array) { + if(array && !unary->ctor.exp) { const Type base = array_base(t); if(GET_FLAG(base, abstract)) CHECK_BN(abstract_array(env, array)); } diff --git a/src/parse/check.c b/src/parse/check.c index 7dafbd90..455ab147 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -966,7 +966,6 @@ ANN static Type check_exp_binary(const Env env, const Exp_Binary *bin) { } if(bin->rhs->exp_type == ae_exp_call && !bin->rhs->d.exp_call.tmpl) bin->rhs->d.exp_call.other = bin->lhs; - const m_uint scope = env->scope->depth; CHECK_OO(check_exp(env, bin->rhs)); if (is_auto) { assert(bin->rhs->type == bin->lhs->type); diff --git a/src/parse/scan1.c b/src/parse/scan1.c index a8fd5488..caa6b272 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -118,7 +118,7 @@ ANN static m_bool scan1_decl(const Env env, Exp_Decl *const decl) { ERR_B(decl->td->pos, _("arrays with no expressions should be declared `late`")); if (GET_FLAG(decl->td, late) && decl->td->array->exp) ERR_B(decl->td->array->exp->pos, _("late array should have no size")); - if (GET_FLAG(base, abstract)) CHECK_BB(abstract_array(env, decl->td->array)); + if (!decl->args && GET_FLAG(base, abstract)) CHECK_BB(abstract_array(env, decl->td->array)); } const Value v = vd->value = vd->value ?: new_value(env, t, s_name(vd->xid), vd->pos); -- 2.43.0