diff options
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 13 | ||||
-rw-r--r-- | script/vm/function.lua | 9 |
2 files changed, 17 insertions, 5 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index e62f7843..00c8170c 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1519,9 +1519,16 @@ local compilerSwitch = util.switch() end end end - if lastReturn and not hasMarkDoc and lastReturn.types[1][1] == '...' then - hasMarkDoc = true - vm.setNode(source, vm.declareGlobal('type', 'unknown')) + if lastReturn + and not hasMarkDoc then + if lastReturn.types[1][1] == '...' then + hasMarkDoc = true + vm.setNode(source, vm.declareGlobal('type', 'unknown')) + end + if lastReturn.name and lastReturn.name[1] == '...' then + hasMarkDoc = true + vm.setNode(source, vm.compileNode(lastReturn)) + end end end local hasReturn diff --git a/script/vm/function.lua b/script/vm/function.lua index 9efcbd32..bdb70faf 100644 --- a/script/vm/function.lua +++ b/script/vm/function.lua @@ -113,8 +113,13 @@ function vm.countReturnsOfFunction(func, mark) end end end - if lastReturn and lastReturn.types[1][1] == '...' then - dmax = math.huge + 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 end if dmin and (not min or (dmin < min)) then min = dmin |