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

incorrectly reported overflow exception #4383

Open
AlbertoCentonze opened this issue Nov 29, 2024 · 0 comments · May be fixed by #4385
Open

incorrectly reported overflow exception #4383

AlbertoCentonze opened this issue Nov 29, 2024 · 0 comments · May be fixed by #4385
Assignees
Labels
bug - type 0 compiler halts or panics instead of generating code bug - typechecker issue with typechecker bug - UX a bug related to UX

Comments

@AlbertoCentonze
Copy link
Contributor

Version Information

  • vyper Version (output of vyper --version): 0.4.0

What's your issue about?

@external
def foo() -> uint256:
    return (10**18)**2

panics at compilation with the following error, which is clearly wrong given that 10**36 clearly fits in a uint256:

vyper.exceptions.OverflowException: Base is too large, calculation will always overflow

  contract "contracts/token.vy:3", function "foo", line 3:12 
       2 def foo() -> uint256:
  ---> 3     return (10**18)**2
  -------------------^
@AlbertoCentonze AlbertoCentonze added the needs triage needs triage label Nov 29, 2024
@charles-cooper charles-cooper added bug - UX a bug related to UX bug - typechecker issue with typechecker bug - type 0 compiler halts or panics instead of generating code and removed needs triage needs triage labels Dec 2, 2024
@tserg tserg linked a pull request Dec 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - type 0 compiler halts or panics instead of generating code bug - typechecker issue with typechecker bug - UX a bug related to UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants