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
When a class is matched with its array it should produce a diagnostic error.
Actual Behaviour
No diagnostic error is produced when a class array is matched with a class.
Reproduction steps
- Paste the following code:
---@class classA
local a
---@type classA[]
local b
---@param param1 classA[]
---@return classA
local function testFunc(param1)
param1 = a
return b
end
local result = testFunc(a)
- Assigning
param1
, returningb
and callingtestFunc
witha
should all produce diagnostic errors, but no diagnostic error is produced.
Additional Notes
Another class, such as classB
can be matched with classA[]
without error.
Log File
No response