-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
Implements
directive behave inconsistently with default
parameters
#3170
Comments
Implements
directive behave inconsistently with defaults parametersImplements
directive behave inconsistently with default
parameters
Some good finds today |
Can confirm the inconsistent behavior. Let me document another example, the from vyper.interfaces import ERC721
implements: ERC721
@external
@payable
def safeTransferFrom(owner: address, to: address, token_id: uint256, data: Bytes[1024]):
... So the |
btw, it should be allowed to use |
That's a good point. Maybe we should always enforce defaults to be |
Version Information
vyper --version
): 0.3.8+commit.6020b8bbpython --version
): 3.8.0What's your issue about?
While Vyper allows defaults to be mentioned in interfaces, the concrete default values are ignored and the only thing done by the presence of such values in the interface is to adds an overload of the given function.
Mixing such interfaces with the
implements
directive lead to some inconsistent behaviours.implements
directive with an interface declaring a function with default arguments, it is enough for the contract implementing it to define the "long overload", for example, the following contract compiles although the functiongoo()
is not implemented (note that a call totest()
would then revert)implements
directive as the short overload is somehow not taken into account. To illustrate, this contract would not compile because of theimplements
.The text was updated successfully, but these errors were encountered: