summaryrefslogtreecommitdiff
path: root/test/definition
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-05-15 17:30:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-05-15 17:30:22 +0800
commit91c8da46833320274f874250d21b71da05cf9689 (patch)
tree4e6fde10bb427e03f4cf17a9b195ac8cfa41b857 /test/definition
parented85e835a9ee6b6e4e36a8bcf8772a92c165558b (diff)
downloadlua-language-server-91c8da46833320274f874250d21b71da05cf9689.zip
update generic
Diffstat (limited to 'test/definition')
-rw-r--r--test/definition/luadoc.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 2b9ec464..953b7f0d 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -349,6 +349,14 @@ local <?<!f2!>?> = f()
TEST [[
---@generic T
+---@type fun(x: T):T
+local f
+
+local <?<!v2!>?> = f(<!{}!>)
+]]
+
+TEST [[
+---@generic T
---@param x T
---@return fun():T
local function f(x) end
@@ -358,6 +366,15 @@ local <?<!v2!>?> = v1()
]]
TEST [[
+---@generic T
+---@type fun(x: T):fun():T
+local f
+
+local v1 = f(<!{}!>)
+local <?<!v2!>?> = v1()
+]]
+
+TEST [[
---@generic V
---@return fun(x: V):V
local function f(x) end