summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta/template/basic.lua4
-rw-r--r--meta/template/table.lua4
-rw-r--r--script/parser/luadoc.lua13
-rw-r--r--test/hover/init.lua8
4 files changed, 10 insertions, 19 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua
index 980b3dc1..31b10bd1 100644
--- a/meta/template/basic.lua
+++ b/meta/template/basic.lua
@@ -274,8 +274,10 @@ function xpcall(f, msgh, arg1, ...) end
---@version 5.1
---#DES 'unpack'
----@param list table
+---@generic T
+---@param list T[]
---@param i? integer
---@param j? integer
+---@return T
---@nodiscard
function unpack(list, i, j) end
diff --git a/meta/template/table.lua b/meta/template/table.lua
index c55c3160..3ec92ce8 100644
--- a/meta/template/table.lua
+++ b/meta/template/table.lua
@@ -56,9 +56,11 @@ function table.sort(list, comp) end
---@version >5.2, JIT
---#DES 'table.unpack'
----@param list table
+---@generic T
+---@param list T[]
---@param i? integer
---@param j? integer
+---@return T
---@nodiscard
function table.unpack(list, i, j) end
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index cfde757b..4dbece5a 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -627,19 +627,6 @@ local function parseResume(parent)
result.additional = additional
end
- local tp = peekToken()
- if tp ~= 'string' then
- pushWarning {
- type = 'LUADOC_MISS_STRING',
- start = getFinish(),
- finish = getFinish(),
- }
- return nil
- end
- local _, str = nextToken()
- result[1] = str
- result.start = getStart()
- result.finish = getFinish()
return result
end
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 9cb24d3d..1493dfd9 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -311,7 +311,7 @@ end
]]
[[
function x()
- -> any
+ -> unknown
]]
TEST [[
@@ -367,19 +367,19 @@ local function f()
end
local <?n?> = f()
]]
-[[local n: any]]
+[[local n: unknown]]
TEST [[
local <?n?> = table.unpack(t)
]]
-[[local n: any]]
+[[local n: unknown]]
TEST [[
local <?n?>
table.pack(n)
]]
[[
-local n: any
+local n: unknown
]]
TEST [[