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
no warnings when annotating a union type of ---@param some_param Class|Class[]
---@classSomeClass---@field[1]string-- ...---@paramsome_paramSomeClass|SomeClass[]localfunctionsome_fn(some_param) returnend-- pretend to do some work-- both should be validsome_fn { { "test" } }
some_fn { "test" }
Actual Behaviour
---@classSomeClass---@field[1]string-- ...---@paramsome_paramSomeClass|SomeClass[]localfunctionsome_fn(some_param) returnendsome_fn { { "test" } } -- <- diagnostic: "Cannot assign `table` to `string`."some_fn { "test" } -- <- this is valid.
array-only is valid:
---@paramsome_paramSomeClass[]localfunctionsome_fn(some_param) returnendsome_fn { {"test"} } -- <- this is valid.
without using a class it is valid and correctly type checked:
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Type Checking
Expected Behaviour
no warnings when annotating a union type of
---@param some_param Class|Class[]
Actual Behaviour
array-only is valid:
without using a class it is valid and correctly type checked:
Reproduction steps
try the code above while having it checked with sumenko lua
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: