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

integer overflow not highlighted as an error #1862

Open
ngc6302h opened this issue Apr 16, 2024 · 0 comments
Open

integer overflow not highlighted as an error #1862

ngc6302h opened this issue Apr 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ngc6302h
Copy link

ngc6302h commented Apr 16, 2024

integer overflow not highlighted as an error

The following code should have a hover error over the assignment to 500, as 500 would overflow the 8 bit integer. zls, however, doesn't say anything about this.

const std = @import("std");

pub fn main() u8 {
    const k : u8 = 500;
    return k;
}
@ngc6302h ngc6302h added the enhancement New feature or request label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant