Open
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
I have a file with two functions that both cast a local variable to a different type. This works perfectly for the first function but fails for the second (or the last if I add more functions).
Actual Behaviour
Error Unknown type conversion variable item (unknown-cast-variable)
for the ---@cast item B
inside fu()
.
Reproduction steps
---@alias A table
---@alias B table
---@type table<number, A>
local items = {}
function fu()
local item = items[1]
---@cast item B
end
function bar()
local item = items[1]
-- Error appears here:
---@cast item B
end
Additional Notes
No response
Log File
No response