Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix overloading example from the docs #4185

Open
Czar102 opened this issue Jul 27, 2024 · 0 comments
Open

Fix overloading example from the docs #4185

Czar102 opened this issue Jul 27, 2024 · 0 comments

Comments

@Czar102
Copy link

Czar102 commented Jul 27, 2024

What's your issue about?

The docs give an example of an overloaded function:

@external
def add_seven(a: int128) -> int128:
    return a + 7

@external
def add_seven_with_overloading(a: uint256, b: uint256 = 3):
    return a + b

And add_seven_with_overloading(10) returns 13 instead of 17. How did this happen?

How can it be fixed?

Set the default value of b to seven instead of three. I think.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant