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

Overload intellisense issue with type of parameters

Open Rathoz opened this issue 1 year ago • 1 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

a is string|number

Actual Behaviour

a is string

Reproduction steps

---@overload fun(a: string): string
---@overload fun(a: number): table
function Foo.Bar(a)
	-- `a` is incorrectly assumed to be a `string`
	return a:lower() -- This does not error while it should!
end

Additional Notes

No response

Log File

No response

Rathoz avatar Jun 12 '24 14:06 Rathoz