-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Fix string.concat and bytes.concat assignment to a constant variable.
#16341
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
base: develop
Are you sure you want to change the base?
Conversation
string.concat and bytes.concat assignment to a constant variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type_information_pure_assignment_error.sol
I don't see any errors in this file :)
| } | ||
|
|
||
| contract A { | ||
| bytes constant aName = type(A).creationCode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about runtimeCode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
math_functions_pure_assignment_error.sol
Well, if you exclude keccak, the main common thing between them is that they are wrappers over precompiles. And due to this they might behave differently in some aspects so I'd test them as that and do keccak separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also have sha() there twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should cover also the block/tx/msg properties.
And global functions like blockhash()/blockhash().
Initially reviewed here #16335
This PR fixes assignment to a constant variable of a result of string or bytes concatenation, if their arguments are values known in the compile-time.
Closes: #16188
Additionally