-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Allow using pure functions in assignment to constant variables #3122
Comments
Only a limited set of expressions are accepted as "pure" for compile-time constants and currently Though it may be feasible lifting that restriction since we have a visibility checker in place now, though I would rather opt to restrict it even further (sha256/ripemd160 is part of it, yet it will compiled into a |
I'd argue against allowing any |
Any progress on this? |
The current status is that this depends on #3157, and that one first needs some design decisions from @ekpyron. It's one of our roadmap goals for this year, but we also have immutable reference types on the roadmap and I think @ekpyron will be working on them first. The question is also how breaking it will be. Changing how |
This issue has been marked as stale due to inactivity for the last 90 days. |
I have a contract I'm trying to compile that imports another contract with a pure / constant function as below:
Any idea why it's saying
Initial value for constant variable has to be compile-time constant.
for this line:uint256 public constant GAS_TO_REPORT = Reporting.gasToReport();
?The text was updated successfully, but these errors were encountered: