From 69339025e98cf29d92b5349ef359be7425ef8087 Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Wed, 6 Nov 2024 15:36:12 +0800 Subject: [PATCH] refactor: address review feedback --- src/puyapy/awst_build/eb/arc4/_base.py | 3 +++ src/puyapy/awst_build/eb/arc4/string.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/puyapy/awst_build/eb/arc4/_base.py b/src/puyapy/awst_build/eb/arc4/_base.py index 4a02657ddf..722ca7d19e 100644 --- a/src/puyapy/awst_build/eb/arc4/_base.py +++ b/src/puyapy/awst_build/eb/arc4/_base.py @@ -138,6 +138,9 @@ class _ARC4ArrayExpressionBuilder(BytesBackedInstanceExpressionBuilder[pytypes.A @typing.override def iterate(self) -> Expression: if not self.pytype.items.wtype.immutable: + # this case is an error raised during AWST validation + # adding a front end specific message here to compliment the error message + # raise across all front ends logger.info( "use `algopy.urange(.length)` to iterate by index", location=self.source_location, diff --git a/src/puyapy/awst_build/eb/arc4/string.py b/src/puyapy/awst_build/eb/arc4/string.py index 53cec51ab0..de9bfac6e8 100644 --- a/src/puyapy/awst_build/eb/arc4/string.py +++ b/src/puyapy/awst_build/eb/arc4/string.py @@ -103,10 +103,13 @@ def augmented_assignment( else: value = expect.argument_of_type_else_dummy(rhs, self.pytype).resolve() + # TODO: does this actually need to be a AugmentedAssignment node to ensure LHS is only + # evaluated once + lhs = self.single_eval().resolve_lvalue() return AssignmentStatement( - target=self.resolve_lvalue(), + target=lhs, value=ArrayConcat( - left=self.resolve(), + left=lhs, right=value, wtype=wtypes.arc4_string_alias, source_location=location,