Open
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Diagnostics/Syntax Checking, Hover
Expected Behaviour
Given the following code
local arr = {}
for k,v in pairs(arr) do
if k == 1 then
print("k == 1")
error("hi", k, v)
else
error("hi", k, v)
end
end
print("hello world")
print
in the last line should not be marked as unreachable, since arr is empty and error
is never called.
Actual Behaviour
print
in the last line is marked as unreachable.
Reproduction steps
- Open New Tab in VSCode
- Paste code example from above
- if not set automatically, change language to lua
- see last line being greyed out
Additional Notes
No response
Log File
No response