-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Autofix on mutating constant #1621
Labels
enhancement
New feature or request
Comments
I don't think auto |
this is zls not zig but if that's still your opinion, then the var->const autofix shouldn't be in zls either |
I think the zls autofix should change how the var to const works then to add a |
fixed by #1652 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Due to #1607 if you write something like
var foo: usize = 0
and then you run autofix (my autofix runs on save) it will turn intoconst foo: usize = 0
and if you mutate it later by addingfoo += 1
for example, you will get an error for attempting to assign to a constant.The text was updated successfully, but these errors were encountered: