Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding definitions for mapping parameters #1221

Merged

Conversation

beta-ziliani
Copy link
Contributor

Fixes #1213

I had to make the rule for [MappingType] fault-tolerant in order to accommodate for older versions of Solidity, by splitting it in two.

Questions:

  • Is it possible to avoid having to make a query for each key or value parameter, and instead have [Identifier]? and query for its existence?
  • The nodes for the parameters are "hanging in the air", as they don't participate in anything useful. Should we attach them to the mapping somehow?

Copy link

changeset-bot bot commented Jan 17, 2025

⚠️ No Changeset found

Latest commit: 49bdddf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@beta-ziliani beta-ziliani marked this pull request as ready for review January 17, 2025 20:33
@beta-ziliani beta-ziliani requested review from a team as code owners January 17, 2025 20:33
@ggiraldez
Copy link
Contributor

ggiraldez commented Jan 20, 2025

  • Is it possible to avoid having to make a query for each key or value parameter, and instead have [Identifier]? and query for its existence?

Unfortunately no. Because if the node is not present, the query engine will not create the appropriate capture key and this will result in a panic. I think this should be considered a bug (reported as #1222, with caveats).

  • The nodes for the parameters are "hanging in the air", as they don't participate in anything useful. Should we attach them to the mapping somehow?

I think it's fine as is, since there is no language support for referencing those names.

Copy link
Contributor

@ggiraldez ggiraldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@beta-ziliani beta-ziliani added this pull request to the merge queue Jan 23, 2025
Merged via the queue into NomicFoundation:main with commit be914d9 Jan 23, 2025
1 check passed
@beta-ziliani beta-ziliani deleted the beta/mapping_named_parameters branch January 23, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unbound named parameters in mapping types
2 participants