From c61cfa373c79c885586a3ed3c27fd86deaa6901a Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 5 Feb 2021 09:20:25 +0000 Subject: [PATCH] Make dynamic array elements unassignable --- source/modules/soul_core/compiler/soul_AST.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/modules/soul_core/compiler/soul_AST.h b/source/modules/soul_core/compiler/soul_AST.h index b1b1b73..1f7aef2 100644 --- a/source/modules/soul_core/compiler/soul_AST.h +++ b/source/modules/soul_core/compiler/soul_AST.h @@ -2111,9 +2111,7 @@ struct AST if (! isResolved()) return ! isConstant; - auto t = getType(); - - return ! (t.isConst() || t.isUnsizedArray()); + return ! getType().isConst(); } Type getType() const @@ -2420,7 +2418,14 @@ struct AST { } - bool isAssignable() const override { return object->isAssignable(); } + bool isAssignable() const override + { + if (object->getResultType().isUnsizedArray()) + return false; + + return object->isAssignable(); + } + bool isOutputEndpoint() const override { return object->isOutputEndpoint(); } bool isResolved() const override