Closed
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
Looking at this code, the variable local bb should be of type fun(x: number, y: number).
the variable local aa should be of type number.
`---@Class Person
---@field age? number
---@field foo? fun(x: number, y: number)
---@param person Person
local function test(person)
if (person.age ~= nil) then
local aa = person.age -- type is number?
end
if (person.foo ~= nil) then
local bb= person.foo -- type is unknown
end
end
`
Actual Behaviour
the variable local aa be of type number?
the variable local bb be of type unknown
Reproduction steps
- Go to '...'
- Click '...'
- See error '...'
Additional Notes
No response
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels