summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 00c8170c..46f6d0e9 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -479,7 +479,12 @@ function vm.getReturnOfFunction(func, index)
if func.type == 'doc.type.function' then
local rtn = func.returns[index]
if not rtn then
- return nil
+ local lastReturn = func.returns[#func.returns]
+ if lastReturn and lastReturn.name and lastReturn.name[1] == '...' then
+ rtn = lastReturn
+ else
+ return nil
+ end
end
local sign = getObjectSign(func)
if not sign then