From 0c7a22d1106cd97b47cb969e2ccfd86ca7ae2629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 20 Oct 2022 20:49:11 +0800 Subject: ignore varargs if a function only has varargs and has `---@overload`, the varargs will be ignored resolve #1641 --- test/crossfile/hover.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test/crossfile') diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index c3d7078c..6d1f3df6 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -1606,3 +1606,41 @@ someType: | "#" -- description ```]] } + +TEST { { path = 'a.lua', content = [[ +---@overload fun(x: number) +---@overload fun(x: number, y: number) +local function (...) +end +]] }, +hover = [[ +```lua +function f(x: number) +``` + +--- + +```lua +function f(x: number, y: number) +```]] +} + +TEST { { path = 'a.lua', content = [[ +---@overload fun(x: number) +---@overload fun(x: number, y: number) +local function f(...) +end + + +]] }, +hover = [[ +```lua +function f(x: number) +``` + +--- + +```lua +function f(x: number, y: number) +```]] +} -- cgit v1.2.3