Skip to content

Correctly support endpoint expressions with multiple chained assigns - #7237

Closed
alextwoods wants to merge 1 commit into
masterfrom
alexwoo/ep_multiple_assign_fix
Closed

Correctly support endpoint expressions with multiple chained assigns#7237
alextwoods wants to merge 1 commit into
masterfrom
alexwoo/ep_multiple_assign_fix

Conversation

@alextwoods

Copy link
Copy Markdown
Contributor

Correctly support endpoint expressions with multiple chained assigns.

Motivation and Context

Codegen for endpoint rules with expressions with multiple chained assigns were failing because we our codegen would visit each assign and collect them and then after all were visited only then generate the lets, but since the generating the lets is what updates the symbol table we were not able to find the result of earlier assigns. Basically an endpoint rule like:

isoArn = aws.parseArn(ResourceARN) && isoArnType = isoArn.resourceId[0] 

In the above expression the isoArnType assign needs to use the resul tof the first assing to isoArn, which currently fails with:

  Cannot find a member with name `resourceId` for type `Void`,  
  Cannot find type for expression `(get-member isoArn resourceId)`,  
  Cannot find type for variable `isoArnType`,

Modifications

When visiting letExpressions we need to visit and process them sequentially - that is, we need to process the bindings AND register the types.

Testing

Added codegen test with previously failing example ruleset.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.

License

  • I confirm that this pull request can be released under the Apache 2 license

@alextwoods
alextwoods requested a review from a team as a code owner August 7, 2026 15:02
@alextwoods
alextwoods requested a review from zoewangg August 7, 2026 15:08
@alextwoods
alextwoods force-pushed the alexwoo/ep_multiple_assign_fix branch from 99fb296 to ca3e85b Compare August 7, 2026 15:42
@alextwoods alextwoods closed this Aug 7, 2026
@alextwoods
alextwoods deleted the alexwoo/ep_multiple_assign_fix branch August 7, 2026 15:43
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant