diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 01:41:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 01:41:16 +0800 |
commit | 7b3e7f4b0a62b7c9c3b895e89b4fe79bb8f350ba (patch) | |
tree | ee441dc6545127e650c6fcf435c96d33079ac177 /test | |
parent | d1e977ca8a6d72673649282bcd1973b1d279a8a1 (diff) | |
download | lua-language-server-7b3e7f4b0a62b7c9c3b895e89b4fe79bb8f350ba.zip |
fix
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/common.lua | 11 | ||||
-rw-r--r-- | test/hover/init.lua | 16 | ||||
-rw-r--r-- | test/type_inference/init.lua | 12 |
3 files changed, 25 insertions, 14 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index 4edb9703..d640e45a 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1620,3 +1620,14 @@ local n print(n.x) ]] + +TEST [[ +---@diagnostic disable: unused-local, unused-function, undefined-global + +function F() end + +---@param x boolean +function F(x) end + +F(k()) +]] diff --git a/test/hover/init.lua b/test/hover/init.lua index 1b6b2231..7fec9254 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1949,8 +1949,8 @@ x({}, <?function?> () end) ]] TEST [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end @@ -1964,8 +1964,8 @@ function f() ]] TEST [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end @@ -1974,12 +1974,12 @@ local n2 = <?f?>(0) local n3 = f(0, 0) ]] [[ -local f: fun(x: any):number +local f: fun(x: number):number ]] TEST [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end @@ -1988,5 +1988,5 @@ local n2 = f(0) local n3 = <?f?>(0, 0) ]] [[ -local f: fun(x: any, y: any):string +local f: fun(x: number, y: number):string ]] diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index ad1df8e0..74ac7120 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2929,8 +2929,8 @@ local <?x?> = f(r1()) ]] TEST 'boolean' [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end @@ -2940,8 +2940,8 @@ local n3 = f(0, 0) ]] TEST 'number' [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end @@ -2951,8 +2951,8 @@ local n3 = f(0, 0) ]] TEST 'string' [[ ----@overload fun(x, y):string ----@overload fun(x):number +---@overload fun(x: number, y: number):string +---@overload fun(x: number):number ---@return boolean local function f() end |