summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-29 20:22:14 +0800
committersumneko <sumneko@hotmail.com>2019-04-29 20:22:14 +0800
commiteec1da3f170a0fc90844860f0c877e38765466b1 (patch)
tree35821229794dd6923c4803db64775154b3e9c714 /server/test
parent9a1b32c07764bfa441d184d97ae90d271bfb9012 (diff)
downloadlua-language-server-eec1da3f170a0fc90844860f0c877e38765466b1.zip
emmy.vararg
Diffstat (limited to 'server/test')
-rw-r--r--server/test/hover/init.lua45
1 files changed, 33 insertions, 12 deletions
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index 24cf8789..5e46bf26 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -609,15 +609,36 @@ function f()
-> A|B, C
]]
---TEST [[
------@generic T
------@param x T
------@return T
---local function f(x)
---end
---
---local <?r?> = f(1)
---]]
---[[
---local r: number = 1
---]]
+TEST [[
+---@generic T
+---@param x T
+---@return T
+local function f(x)
+end
+
+local <?r?> = f(1)
+]]
+[[
+local r: number
+]]
+
+TEST [[
+---@vararg Class
+local function f(...)
+ local _, <?x?> = ...
+end
+f(1, 2, 3)
+]]
+[[
+local x: *Class = 2
+]]
+
+TEST [[
+---@vararg Class
+local function f(...)
+ local _, <?x?> = ...
+end
+]]
+[[
+local x: *Class {}
+]]