diff options
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 |