diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 20:45:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 20:45:23 +0800 |
commit | 317bced17780ebdeed67ed17590b7e2598b2b55a (patch) | |
tree | faa924c96bfbe9305434de0ca70e6649fd0d8113 /test/hover/init.lua | |
parent | bb1244fa62c0158490d2e54da0a19f28f16fe994 (diff) | |
download | lua-language-server-317bced17780ebdeed67ed17590b7e2598b2b55a.zip |
update
Diffstat (limited to 'test/hover/init.lua')
-rw-r--r-- | test/hover/init.lua | 43 |
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 +]] |