Skip to content
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

Obscure message for UnimplementedException #2840

Closed
matiasbattocchia opened this issue May 4, 2022 · 1 comment · Fixed by #2843
Closed

Obscure message for UnimplementedException #2840

matiasbattocchia opened this issue May 4, 2022 · 1 comment · Fixed by #2843

Comments

@matiasbattocchia
Copy link

Version Information

  • vyper Version (output of vyper --version): 0.3.3
  • OS: linux
  • Python Version (output of python --version): 3.9.12

What's your issue about?

Arithmetic operator are only implemented for uint8 and uint256 but the compiler could not tell it when using the addition assignment (+=).

sum: uint16 = 0
equities: uint16[3] = [1, 2, 3]

for equity in equities:
    sum += equity
$ brownie compile

vyper.exceptions.UnimplementedException: <exception str() failed>

Then changed code to

sum: uint16 = 0
equities: uint16[3] = [1, 2, 3]

for equity in equities:
    sum = sum + equity

and finally could spot the problem.

$ brownie compile

vyper.exceptions.UnimplementedException: Not implemented: uint16 + uint16
  contract "contracts/DaiCell.vy", function "__init__", line 25:14 
       24     for equity in equities:
  ---> 25         sum = sum + equity
@charles-cooper
Copy link
Member

well, the solution is to implement it :)

tracking in #2786

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

Successfully merging a pull request may close this issue.

2 participants