summaryrefslogtreecommitdiff
path: root/test/hover/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-21 20:45:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-21 20:45:23 +0800
commit317bced17780ebdeed67ed17590b7e2598b2b55a (patch)
treefaa924c96bfbe9305434de0ca70e6649fd0d8113 /test/hover/init.lua
parentbb1244fa62c0158490d2e54da0a19f28f16fe994 (diff)
downloadlua-language-server-317bced17780ebdeed67ed17590b7e2598b2b55a.zip
update
Diffstat (limited to 'test/hover/init.lua')
-rw-r--r--test/hover/init.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 0925db77..1b6b2231 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -1947,3 +1947,46 @@ x({}, <?function?> () end)
[[
(async) function ()
]]
+
+TEST [[
+---@overload fun(x, y):string
+---@overload fun(x):number
+---@return boolean
+local function f() end
+
+local n1 = <?f?>()
+local n2 = f(0)
+local n3 = f(0, 0)
+]]
+[[
+function f()
+ -> boolean
+]]
+
+TEST [[
+---@overload fun(x, y):string
+---@overload fun(x):number
+---@return boolean
+local function f() end
+
+local n1 = f()
+local n2 = <?f?>(0)
+local n3 = f(0, 0)
+]]
+[[
+local f: fun(x: any):number
+]]
+
+TEST [[
+---@overload fun(x, y):string
+---@overload fun(x):number
+---@return boolean
+local function f() end
+
+local n1 = f()
+local n2 = f(0)
+local n3 = <?f?>(0, 0)
+]]
+[[
+local f: fun(x: any, y: any):string
+]]