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

Disallow dots in user-defined Yul identifiers starting from 0.7.0 #743

Closed
Xanewok opened this issue Jan 13, 2024 · 3 comments · Fixed by #869
Closed

Disallow dots in user-defined Yul identifiers starting from 0.7.0 #743

Xanewok opened this issue Jan 13, 2024 · 3 comments · Fixed by #869
Assignees
Labels
bug Something isn't working

Comments

@Xanewok
Copy link
Contributor

Xanewok commented Jan 13, 2024

https://docs.soliditylang.org/en/v0.8.22/070-breaking-changes.html#inline-assembly

Disallow . in user-defined function and variable names in inline assembly. It is still valid if you use Solidity in Yul-only mode.

@Xanewok Xanewok added the bug Something isn't working label Jan 13, 2024
@Xanewok
Copy link
Contributor Author

Xanewok commented Feb 13, 2024

Yul-only mode is when we pass the --yul flag passed to solc. It's possible to have the following code in the Yul-only mode in 0.7.0 but not in the "regular" mode:

object "MyContract" {
	code {
	    let some.variable := 10
	    let another.variable := 20

	    function add.variables(x, y) -> result {
		result := add(x, y)
	    }

	    let sum := add.variables(some.variable, another.variable)
	}
}

And the example error for assembly block post 0.7.0:

Error: User-defined identifiers in inline assembly cannot contain '.'.
 --> file.sol:5:11:
  |
5 |                 let another.variable := 20
  |                     ^^^^^^^^^^^^^^^^

@OmarTawfik
Copy link
Collaborator

I think it is a different language at this point. One maybe we can tackle once we have language embedding?
Not sure how much it is used though. Maybe we can just disallow it in Solidity for now.

@OmarTawfik OmarTawfik self-assigned this Feb 14, 2024
@OmarTawfik
Copy link
Collaborator

Also: https://soliditylang.org/blog/2019/04/30/solidity-0.5.8-release-announcement

Yul: Support . as part of identifiers.

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

Successfully merging a pull request may close this issue.

2 participants