Closed
Description
Describe the bug
I get a return-type-mismatch
warning for correct lua code.
return valueA and valueB
should use the type of valueB
(see below screenshot)
But when writing code like this (see below screenshot), it suddenly takes the type of valueA
.
To Reproduce
---@return table|nil
function getDetail()
return nil
end
---@return number|nil
function other()
return nil
end
---@return number
function example()
local detail = getDetail()
return detail and other()
end
Expected behavior
Correct type detection.
Environment (please complete the following information):
- OS: Windows 10
- VSCode