summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
commitc78fbf09aa4406db905a8a0e6dd5731871f2c262 (patch)
tree50d1c7005f1ab879608a5738d626370e1a01ac70 /test/type_inference
parented64703ef9fec2b1c6736a0deb68bd567875a654 (diff)
downloadlua-language-server-c78fbf09aa4406db905a8a0e6dd5731871f2c262.zip
#1207
return names and parentheses can be used in `DocFunction`
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua38
1 files changed, 36 insertions, 2 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index e86983b6..db5a38fd 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -510,12 +510,12 @@ TEST 'fun()' [[
local <?x?>
]]
-TEST 'fun(a: string, b: any, ...: any)' [[
+TEST 'fun(a: string, b: any, ...any)' [[
---@type fun(a: string, b, ...)
local <?x?>
]]
-TEST 'fun(a: string, b: any, c?: boolean, ...: any):c, d?, ...' [[
+TEST 'fun(a: string, b: any, c?: boolean, ...any):c, d?, ...' [[
---@type fun(a: string, b, c?: boolean, ...):c, d?, ...
local <?x?>
]]
@@ -3092,3 +3092,37 @@ local function f() end
local _, <?n?> = f()
]]
+
+TEST 'boolean' [[
+---@type fun():name1: boolean, name2:number
+local f
+
+local <?n?> = f()
+]]
+
+TEST 'number' [[
+---@type fun():name1: boolean, name2:number
+local f
+
+local _, <?n?> = f()
+]]
+TEST 'boolean' [[
+---@type fun():(name1: boolean, name2:number)
+local f
+
+local <?n?> = f()
+]]
+
+TEST 'number' [[
+---@type fun():(name1: boolean, name2:number)
+local f
+
+local _, <?n?> = f()
+]]
+
+TEST 'boolean' [[
+---@type fun():...: boolean
+local f
+
+local _, <?n?> = f()
+]]