Skip to content

Commit

Permalink
Make dynamic array elements unassignable
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaref committed Feb 5, 2021
1 parent 2a70c5d commit c61cfa3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/modules/soul_core/compiler/soul_AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -2111,9 +2111,7 @@ struct AST
if (! isResolved())
return ! isConstant;

auto t = getType();

return ! (t.isConst() || t.isUnsizedArray());
return ! getType().isConst();
}

Type getType() const
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c61cfa3

Please sign in to comment.