lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Overload intellise prototype issue with meta functions

Open Rathoz opened this issue 1 year ago • 2 comments

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

type of b should be string

Actual Behaviour

type of b is string|nil

Reproduction steps

---@meta
local Foo = {}
---@overload fun(a: string): string
---@overload fun(a: number): table
function Foo.Bar(a)
end

local b = Foo.Bar('abc') -- type of is `string|nil`

Additional Notes

image

Log File

No response

Rathoz avatar Jun 12 '24 15:06 Rathoz