How are you using the lua-language-server?
Other
Which OS are you using?
Linux
What is the issue affecting?
Type Checking, Diagnostics/Syntax Checking
Expected Behaviour
When using a value from an array as a parameter I expect type checking to work.
Actual Behaviour
Type checking only works when I assign the value from the array to a temporary variable, not when passing it to a function directly.
Reproduction steps
This doesn't show a warning:
---@param num integer
function receive(num)
end
---@type (integer?)[]
local values = {}
receive(values[1])
This works:
local value = values[1]
receive(value) -- Cannot assign `integer?` to parameter `integer`.
Additional Notes
No response
Log File
No response