summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-27 19:24:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-27 19:24:18 +0800
commit426ee9071b8aabcd9065ba7055d8ac416c95641d (patch)
treefc4b77460636cc559dd1e42fe6475f17be89dcc0 /test
parentc88ea6274f90bad38db2383e67121c2ae48c7970 (diff)
downloadlua-language-server-426ee9071b8aabcd9065ba7055d8ac416c95641d.zip
stash
Diffstat (limited to 'test')
-rw-r--r--test/definition/luadoc.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 438425f3..61f203f5 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -321,13 +321,27 @@ print(v1[1].<?bar1?>)
--]]
TEST [[
+---@type fun():<!fun()!>
+local f
+
+local <?<!f2!>?> = f()
+]]
+
+TEST [[
---@class Foo
local Foo = {}
function Foo:<!bar1!>() end
---@type table<number, Foo>
local v1
-local ipairs = ipairs
+
+---@generic T: table, V
+---@param t T
+---@return fun(table: V[], i?: integer):integer, V
+---@return T
+---@return integer i
+local function ipairs(t) end
+
for i, v in ipairs(v1) do
print(v.<?bar1?>)
end
@@ -340,6 +354,14 @@ function Foo:<!bar1!>() end
---@type table<Foo, Foo>
local v1
+
+---@generic T: table, K, V
+---@param t T
+---@return fun(table: table<K, V>, index: K):K, V
+---@return T
+---@return nil
+local function pairs(t) end
+
for k, v in pairs(v1) do
print(k.<?bar1?>)
print(v.bar1)