I frequently use goto continue with a ::continue:: label as a proxy for Lua's lack of a first-class continue 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 introducing do ... end blocks.
Could be a nice warning/lint/error to be able to see via Luacheck.
Here's an extremely simple self contained example:
🐧 ❯ cat init.lua
function bad_goto_loop()
while true do
goto continue
local some_var = "foo"
::continue::
print("loop end, starting again")
end
end
🐧 ❯ lua init.lua
lua: init.lua:6: <goto continue> at line 3 jumps into the scope of local 'some_var'