Open PennyJim opened 1 month ago
In an attempt to band-aid what I originally luals choking a little, I tried casting it. Only to find it was in fact unaware it even existed.
There is another strange bug that existed for a while. When you use @cast
on a variable which has no more access to it later, it will complain unless the file has a trailing newline (yeah~ strange 🙈 )
see: https://github.com/LuaLS/lua-language-server/issues/2326
do
---@class A
local a
---@cast a A
end -- no trailing new line
do
---@class A
local a
---@cast a A
end
-- add trailing new line here
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?
Type Checking
Expected Behaviour
I was trying to fetch a table that could be within a number of tables. Leaving early if it was found
I wanted that locally scoped variable to be the same type after the loop as before it
Actual Behaviour
Only for my variable scoped outside the loop to be unknown after it. In an attempt to band-aid what I originally luals choking a little, I tried casting it. Only to find it was in fact unaware it even existed.
Reproduction steps
As minimal I can get the code to be and reproduce it:
Additional Notes
No response
Log File
service.log