-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
const local variable is not constant at all #10575
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although it is not that important for the compiler/optimizer to declare a local constant variable as it can probably figure out itself, it is still useful as a hint/constraint for the user to avoid stupid error or breakage sometimes.
IMHO, as long as local const variable is a valid syntax, it should at least give a warning if the value/binding changes (just as the global one). It might even make sense to be more restrictive and make that an error instead of a warning.
The text was updated successfully, but these errors were encountered: