[mlir][Sol] Clear kind attr on the inner body when expanding modifiers#74
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts Sol modifier lowering so the renamed inner function body no longer retains constructor/fallback/receive metadata after a wrapper function is created.
Changes:
- Removes the
kindattribute from the originalsol.funcafter cloning it into the new wrapper. - Clarifies via comment that only the wrapper should retain constructor/fallback/receive kind.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vladimirradosavljevic
approved these changes
May 15, 2026
vladimirradosavljevic
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks!
a16263c to
0a928a3
Compare
b6c286a to
1a92b72
Compare
0a928a3 to
5ee78ff
Compare
1a92b72 to
f69d970
Compare
5ee78ff to
3389d13
Compare
f69d970 to
b9f278d
Compare
3389d13 to
5ee78ff
Compare
b9f278d to
f69d970
Compare
5ee78ff to
3389d13
Compare
b9f278d to
ec31d7a
Compare
3389d13 to
032ab99
Compare
032ab99 to
ee9bba7
Compare
The renamed inner body kept its kind attr, so a constructor / fallback / receive with a modifier produced two sol.funcs of the same kind in one sol.contract and tripped ContractOpLowering's uniqueness assert.
ec31d7a to
1d2cd84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NomicFoundation/solx-solidity#130