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

Wrong diagnosis of number literal out of bounds when using a bit mask #679

Open
rnd-ash opened this issue Mar 15, 2024 · 1 comment
Open
Labels

Comments

@rnd-ash
Copy link

rnd-ash commented Mar 15, 2024

As rune forces me to use signed integer types, the compiler will emit an error when trying to use a bitmask on an integer:

Code:

value & 0xff00_0000_0000_0000) >> 0x38

Error:

error: Number literal out of bounds `-9223372036854775808` to `9223372036854775807`
   ┌─ entry:67:17
   │
67 │         (value & 0xff00_0000_0000_0000) >> 0x38 |
   │                 ^^^^^^^^^^^^^^^^^^^^^ Number literal out of bounds `-9223372036854775808` to `9223372036854775807

Is there a way to disable this literal check?

@udoprog udoprog added the bug Something isn't working label Mar 15, 2024
@udoprog
Copy link
Collaborator

udoprog commented Mar 15, 2024

Can't be disabled, but I'm also not sure if we should. Since this matches the behavior of Rust.

In the future I do want to support other integer types, and this would be a valid u64 literal.

@udoprog udoprog added question and removed bug Something isn't working labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants