forked from mpeterv/luacheck
-
Notifications
You must be signed in to change notification settings - Fork 60
[Feature Request] add a warning for goto's that jump across local variable definitions #98
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
Open
Comments
I'm happy to consider a PR for this. In the mean time just a couple comments:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I frequently use
goto continue
with a::continue::
label as a proxy for Lua's lack of a first-classcontinue
keyword and I often find myself getting bit by jumping over a local variable declaration that doesn't go out of scope; easy enough to fix by introducingdo ... end
blocks.Could be a nice warning/lint/error to be able to see via Luacheck.
Here's an extremely simple self contained example:
The text was updated successfully, but these errors were encountered: