vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.81k stars 788 forks source link

feat[ux]: move exception hint to the last position #4154

Open cyberthirst opened 3 weeks ago

cyberthirst commented 3 weeks ago

What I did

example:

original:

vyper.exceptions.InvalidOperation: Cannot perform decimal division on uint256

  (hint: did you mean `10 // 4`?)

  contract "tests/custom/test.vy:3", function "f", line 3:17 
       2 def f(x: Bytes[32*5]):
  ---> 3     k: uint256 = 10 / 4
  ------------------------^

new order:

vyper.exceptions.InvalidOperation: Cannot perform decimal division on uint256

  contract "tests/custom/test.vy:3", function "f", line 3:17 
       2 def f(x: Bytes[32*5]):
  ---> 3     k: uint256 = 10 / 4
  ------------------------^

  (hint: did you mean `10 // 4`?)

edit: fix the example

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()

cyberthirst commented 3 weeks ago

Given how close the 0.4.0 release is, I think it might be wise to merge after the release.