-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adding binding rules to typeof(<enum>).min
and max
, and to <enum>.<member>
so they work with extensions
#1177
base: main
Are you sure you want to change the base?
Conversation
|
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.
I think this needs rebasing on latest main
.
cc @ggiraldez if you don't mind a quick review?
I suppose it's best to wait for #1149 to be in sync with main, and then rebase this one on top of it |
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.
I left a couple of comments that need addressing. Please ping me if you have questions.
crates/solidity/testing/snapshots/bindings_output/expressions/type_expr/input.sol
Outdated
Show resolved
Hide resolved
9bfd79f
to
0a578b3
Compare
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.
This file is a left over from #1196, but it doesn't harm to have it here
typeof(<enum>).min
and max
, and to <enum>.<member>
so they work with extensions
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.
Left a couple of suggestions.
This is ready for another review.
I think the issue is addressed in bd2ad90. I still don't understand why CI was not showing a problem on my end. |
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.
Looks good except for the version restriction on binding enum members.
if (version-matches ">= 0.6.8") { | ||
edge def -> @enum.value_ref_typeof | ||
} |
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.
This should not be version restricted. I tried in Remix and binding enum members work for all our supported versions (eg. >= 0.4.11).
using Id for Answer; | ||
|
||
function testFunc() returns (Answer) { | ||
Answer.Yes.id(); |
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.
This should resolve for all versions, but you'll need to move the enum inside the library
because top-level enums are not supported before 0.6.0.
Fixes #1158.
Fixes #1196.
Considerations:
It's built on top of Solidity binding fixes driven by Sanctuary #1149It's rebased on master.It's currently missing a test formax
I adapted an existing test, though maybe it's preferred to add a different one?using for
, so it can very well be moved to theusing
folder.EDITED