solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Support constants in custom storage layout expression

Open matheusaaguiar opened this issue 9 months ago • 4 comments

part of #15727.

matheusaaguiar avatar Mar 15 '25 15:03 matheusaaguiar

thank you for supporting constants! this is a huge composability unlock!

zaqk avatar Apr 04 '25 13:04 zaqk

Would this also apply to immutables?

zaqk avatar Apr 04 '25 14:04 zaqk

Would this also apply to immutables?

No, this only targets constants. Immutables are a little bit different and demand a different handling.

matheusaaguiar avatar Apr 11 '25 13:04 matheusaaguiar

We can't really support immutables here, because the layout must already be defined at creation time (constructor can initialize state variables), but their values can still change at that point. In case where they do not, the immutable can be replaced by a constant anyway.

@matheusaaguiar Speaking of immutables, please make sure you have a test case against #15989. I.e. one showing that immutables are rejected even if they end up being treated as pure by the compiler.

cameel avatar Apr 11 '25 14:04 cameel

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Jun 19 '25 12:06 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Jul 08 '25 12:07 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Jul 23 '25 12:07 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Aug 07 '25 12:08 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Aug 22 '25 12:08 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Sep 06 '25 12:09 github-actions[bot]

The inability of the constant evaluator to evaluate much at all aside, the PR looks good, so please go over the comments, and we can merge soon.

nikola-matic avatar Sep 08 '25 09:09 nikola-matic

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Sep 26 '25 12:09 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Oct 12 '25 12:10 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Oct 28 '25 12:10 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Nov 12 '25 12:11 github-actions[bot]

This pull request is stale because it has been open for 14 days with no activity. It will be closed in 7 days unless the stale label is removed.

github-actions[bot] avatar Nov 29 '25 12:11 github-actions[bot]