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

AddressType wrongly accepts just payable state mutability as the whole type #654

Closed
Xanewok opened this issue Nov 14, 2023 · 0 comments · Fixed by #756
Closed

AddressType wrongly accepts just payable state mutability as the whole type #654

Xanewok opened this issue Nov 14, 2023 · 0 comments · Fixed by #756
Assignees
Labels
bug Something isn't working

Comments

@Xanewok
Copy link
Contributor

Xanewok commented Nov 14, 2023

YAML spec

- name: "AddressType"
  kind: "Parser"
  unversioned:
    choice:
      - sequence:
          - reference: "AddressKeyword"
          - optional:
              reference: "PayableKeyword"
      - reference: "PayableKeyword"

DSL v1

parser AddressType = ((AddressKeyword (PayableKeyword ?)) | PayableKeyword) ;

DSL v2

Struct(
    name = AddressType,
    fields = (
        address_keyword = Required(Terminal([AddressKeyword])),
        payable_keyword = Optional(kind = Terminal([PayableKeyword]))
    )
)

but ElementaryType accepts PayableKeyword alongside AddressType.

The address type should be address (payable). There is also payable(<address>) conversion expression but that should be handled separately, as payable on its own is not an elementary type.

@Xanewok Xanewok added the bug Something isn't working label Nov 14, 2023
@Xanewok Xanewok moved this to Todo in Slang - 2023 Q4 Nov 14, 2023
@OmarTawfik OmarTawfik assigned OmarTawfik and unassigned OmarTawfik Nov 15, 2023
@OmarTawfik OmarTawfik self-assigned this Jan 28, 2024
OmarTawfik added a commit to OmarTawfik-forks/slang that referenced this issue Jan 28, 2024
Removes `payable` as an elementary type, adding it back to primary expressions (to be parsed as the base of a call expression). More details in NomicFoundation#654

Closes NomicFoundation#654
OmarTawfik added a commit to OmarTawfik-forks/slang that referenced this issue Jan 28, 2024
Removes `payable` as an elementary type, adding it back to primary expressions (to be parsed as the base of a call expression). More details in NomicFoundation#654

Closes NomicFoundation#654
OmarTawfik added a commit to OmarTawfik-forks/slang that referenced this issue Jan 28, 2024
Removes `payable` as an elementary type, adding it back to primary expressions (to be parsed as the base of a call expression). More details in NomicFoundation#654

Closes NomicFoundation#654
OmarTawfik added a commit to OmarTawfik-forks/slang that referenced this issue Feb 3, 2024
Removes `payable` as an elementary type, adding it back to primary expressions (to be parsed as the base of a call expression). More details in NomicFoundation#654

Closes NomicFoundation#654
github-merge-queue bot pushed a commit that referenced this issue Feb 3, 2024
Removes `payable` as an elementary type, adding it back to primary
expressions (to be parsed as the base of a call expression). More
details in #654

Closes #654
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: Todo
Development

Successfully merging a pull request may close this issue.

2 participants