From deac4582d38908c1281d4d5215b7b69ff8400dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Jun 2022 19:28:54 +0800 Subject: parse `---@return ...` a `---@return ... unknown` --- script/vm/function.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'script/vm/function.lua') 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 -- cgit v1.2.3