-
Notifications
You must be signed in to change notification settings - Fork 197
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
ABI Encode Unit Type #671
ABI Encode Unit Type #671
Conversation
@Maltby I went down this road once, and abandoned it because our compiler pipeline wasn't powerful enough to solve this in a satisfactory way. In yul, functions that don't return anything really don't return anything, so they can't be used in a position that expects some kind of value. There's no concept of a zero-sized value (everything is a u256). Fe code like this:
is currently compiled to something like this in yul:
which only works because The "middle" of the compiler is currently being revamped (#661, and a follow-up pr that'll generate yul from mir). My tentative suggestion is that unit types could be eliminated in an optimization pass on mir, and the mir-to-yul codegen could assume that unit types don't exist. Thoughts, @Y-Nak? |
Yeah, I agree with the opinion. We should/could remove unit types from both function call-sites and def-sites. Of course, |
What was wrong?
closes #442
How was it fixed?
To-Do
OPTIONAL: Update Spec if applicable
Add entry to the release notes (may forgo for trivial changes)
Clean up commit history