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

unbound named parameters in mapping types #1213

Closed
OmarTawfik opened this issue Jan 2, 2025 · 0 comments · Fixed by #1221
Closed

unbound named parameters in mapping types #1213

OmarTawfik opened this issue Jan 2, 2025 · 0 comments · Fixed by #1221
Assignees

Comments

@OmarTawfik
Copy link
Contributor

For a mapping type like this:

    mapping(uint256 proposalId => ProposalCore) private _proposals;

The identifier proposalId is not bound to anything, while it should be bound to a new definition, similar to parameter names.

Just skimming through the relevant links below, it seems like its scope is restricted to only the mapping(...), this it cannot be referenced anywhere else for now, but we should double check this:

@github-project-automation github-project-automation bot moved this to ⏳ Todo in Slang - 2024 H2 Jan 2, 2025
OmarTawfik added a commit that referenced this issue Jan 2, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 23, 2025
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?
@github-project-automation github-project-automation bot moved this from ⏳ Todo to ✅ Done in Slang - 2024 H2 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants