-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 selectors to be used in constants assignment and support overloading #7922
Comments
@k06a Thanks for bringing this up. In general, I think that this would be a good reason to re-think member lookup for functions and research if a new syntax, that includes types to be used during overload resolution, can be introduced. You can almost express it in a non-constant way:
but as you might see, the second overloaded version of The syntax you've proposed is already used for an actual function call, so it has to be different. Also the aspect that the ID should be compile-time constant needs to be taken into account. Of course, you could also calculate them on-chain, which would in turn increase gas costs:
|
@k06a So bottom line is: I think we'd need a different proposal for the syntax :-) |
We might also consider native support for interface identifiers. |
@erak what about this syntax? this.selectors.f()
this.selectors.f(uint256) Or use mandatory this.f(void).selector
this.f(uint256).selector So you will be able to distinct calls from selectors by arguments: types or expressions. |
Maybe we could use |
|
Abstract
For example ERC721 contains:
But could contain:
Motivation
Avoiding off-code computations.
The text was updated successfully, but these errors were encountered: