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

Empty tuple decontruction is wrongly parsed as correct #671

Closed
Xanewok opened this issue Nov 21, 2023 · 1 comment
Closed

Empty tuple decontruction is wrongly parsed as correct #671

Xanewok opened this issue Nov 21, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Xanewok
Copy link
Contributor

Xanewok commented Nov 21, 2023

This happens because we use a Separated grammar node parsing an Optional item. Since a missing item is treated as a succesful parse, this doesn't fail.

We should make sure to support parsing (, ...) with at least a single item and/or comma.

For more context:

  • () = () is parsed by Slang as correct but solc rejects it - tuple deconstruction can't be empty
  • (,) = () is rejected by solc at parse level; at least one item should not be skipped/"empty"
  • (a,,),(,a,),(,,a) are all valid deconstructions
@OmarTawfik
Copy link
Contributor

Discussed f2f: let's keep it as-is, and leave such validation to type checking.

@OmarTawfik OmarTawfik closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
@github-project-automation github-project-automation bot moved this from ⏳ Todo to ✅ Done in Slang - 2024 H1 Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: ✅ Done
Development

No branches or pull requests

2 participants