Skip to content

Commit

Permalink
refactor: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Nov 7, 2024
1 parent 43a364e commit 6933902
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/puyapy/awst_build/eb/arc4/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(<array>.length)` to iterate by index",
location=self.source_location,
Expand Down
7 changes: 5 additions & 2 deletions src/puyapy/awst_build/eb/arc4/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6933902

Please sign in to comment.