summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 16:50:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 16:50:51 +0800
commit8772b47c0e2d3761cc6b33769e98223c08ca9629 (patch)
treeea65165a14a7052effca953a53f8698aea5f97d7 /script/vm/compiler.lua
parentf33b06fd928fd3541eea99b11ee6caf9b249a49b (diff)
downloadlua-language-server-8772b47c0e2d3761cc6b33769e98223c08ca9629.zip
fix
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 08fc2296..889c70a1 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -842,6 +842,16 @@ local compilerSwitch = util.switch()
local vararg = source.vararg
if vararg.type == 'call' then
local node = getReturn(vararg.node, source.sindex, vararg.args)
+ if not node then
+ return
+ end
+ for n in nodeMgr.eachNode(node) do
+ if n.type == 'global'
+ and n.cate == 'type'
+ and n.name == '...' then
+ return
+ end
+ end
nodeMgr.setNode(source, node)
end
if vararg.type == 'varargs' then
@@ -855,6 +865,16 @@ local compilerSwitch = util.switch()
: case 'call'
: call(function (source)
local node = getReturn(source.node, 1, source.args)
+ if not node then
+ return
+ end
+ for n in nodeMgr.eachNode(node) do
+ if n.type == 'global'
+ and n.cate == 'type'
+ and n.name == '...' then
+ return
+ end
+ end
nodeMgr.setNode(source, node)
end)
: case 'in'