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

Enforce capacity of integer types #145

Closed
cburgdorf opened this issue Dec 4, 2020 · 0 comments
Closed

Enforce capacity of integer types #145

cburgdorf opened this issue Dec 4, 2020 · 0 comments

Comments

@cburgdorf
Copy link
Collaborator

What is wrong?

It's currently possible to use a type constructor of e.g. u8 and feed it a number that is to high such as u8(1000).

How can it be fixed

  1. When using type constructors with literals it should be enforced that the literal fits into the given type
  2. We will probably also need to specify the type in the generated YUL code. E.g. I would expect that this code:
x = u8(1)

should translate into:

x := 1:u8

Related YUL docs on integer literals

@cburgdorf cburgdorf added this to the Genesis Release 2021 milestone Dec 4, 2020
cburgdorf added a commit to cburgdorf/fe that referenced this issue Dec 14, 2020
cburgdorf added a commit to cburgdorf/fe that referenced this issue Dec 15, 2020
cburgdorf added a commit that referenced this issue Dec 15, 2020
cburgdorf added a commit to cburgdorf/fe that referenced this issue Dec 17, 2020
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

No branches or pull requests

1 participant