summaryrefslogtreecommitdiff
path: root/script/vm/function.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-28 19:28:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-28 19:28:54 +0800
commitdeac4582d38908c1281d4d5215b7b69ff8400dca (patch)
tree833da004bc6bd82dadb373bbc345224160ce0972 /script/vm/function.lua
parent7e778b31476831864dff995ae3ae4e5f223c5726 (diff)
downloadlua-language-server-deac4582d38908c1281d4d5215b7b69ff8400dca.zip
parse `---@return ...` a `---@return ... unknown`
Diffstat (limited to 'script/vm/function.lua')
-rw-r--r--script/vm/function.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/script/vm/function.lua b/script/vm/function.lua
index 8e3662e2..d94e7561 100644
--- a/script/vm/function.lua
+++ b/script/vm/function.lua
@@ -98,16 +98,14 @@ function vm.countReturnsOfFunction(func, mark)
n = n + 1
lastReturn = ret
dmax = n
- if not vm.compileNode(ret):isNullable() then
+ if (not ret.name or ret.name[1] ~= '...')
+ and not vm.compileNode(ret):isNullable() then
dmin = n
end
end
end
end
if lastReturn then
- if lastReturn.types[1][1] == '...' then
- dmax = math.huge
- end
if lastReturn.name and lastReturn.name[1] == '...' then
dmax = math.huge
end