Skip to content

Commit

Permalink
fix: Ensure nested assignments use correct lvalue logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmenzel committed Oct 16, 2024
1 parent c58728b commit df40d08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/awst_build/base-visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export abstract class BaseVisitor implements Visitor<Expressions, NodeBuilder> {
for (const [index, sourceItemType] of enumerate(assignmentType.items)) {
const targetItem = targetItems[index]
if (targetItem && !(targetItem instanceof OmittedExpressionBuilder)) {
targets.push(targetItem.resolveToPType(sourceItemType).resolveLValue())
targets.push(this.buildLValue(targetItem, sourceItemType, sourceLocation))
} else {
targets.push(
nodeFactory.varExpression({
Expand All @@ -574,7 +574,7 @@ export abstract class BaseVisitor implements Visitor<Expressions, NodeBuilder> {
const targets: LValue[] = []
for (const [propName, propType] of assignmentType.orderedProperties()) {
if (target.hasProperty(propName)) {
targets.push(target.memberAccess(propName, sourceLocation).resolveLValue())
targets.push(this.buildLValue(target.memberAccess(propName, sourceLocation), propType, sourceLocation))
} else {
targets.push(
nodeFactory.varExpression({
Expand Down

0 comments on commit df40d08

Please sign in to comment.