You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
muppet9010
changed the title
3.6.3 to 3.6.4 broke the type detection of nested objects
upgrade from 3.6.3 to 3.6.4 broke the type detection of nested objects
Nov 29, 2022
muppet9010
changed the title
upgrade from 3.6.3 to 3.6.4 broke the type detection of nested objects
upgrade from 3.6.3 to 3.6.4 broke the type detection of nested objects when @cast is used
Nov 29, 2022
So it appears this isn't related to the @cast. As the issue occurs without it, it can just take an extra save of the file for the plugin to realise it's unhappy and raise the warning.
---@class Container
---@field object Object
---@class Object
---@field speed number?
local object, x
local things ---@type Container[]
for _, thing in pairs(things) do
object = thing.object
x = object.speed
end
This also shows the issue, but it can take the plugin a bit to flag that x is unknown and raise this is a warning. If it seems happy either just save the file again unchanged can often raise the warning otherwise; make it invalid code (remove d off last end) and save it, then put the d back and save it again.
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?
Annotations, Type Checking
Expected Behaviour
In 3.6.3 the code in Reproduction Steps has the value of
x
resolving to the correct type.Actual Behaviour
In 3.6.4 this is no longer the case and gives the error:
Reproduction steps
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: