summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/matcher/vm.lua3
-rw-r--r--server/test/type_inference/init.lua7
2 files changed, 10 insertions, 0 deletions
diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua
index 3c1b62af..4a23d759 100644
--- a/server/src/matcher/vm.lua
+++ b/server/src/matcher/vm.lua
@@ -271,6 +271,9 @@ function mt:buildFunction(exp, object)
func.argValues[#func.args] = self:getValue(var)
elseif arg.type == '...' then
self:createDots(#func.args+1, arg)
+ for _ = 1, 10 do
+ func.argValues[#func.argValues+1] = self:createValue('any', arg)
+ end
stop = true
end
end)
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua
index d9a23013..bb5add6e 100644
--- a/server/test/type_inference/init.lua
+++ b/server/test/type_inference/init.lua
@@ -165,3 +165,10 @@ local function x(a, ...)
end
x(nil, 'xx', 1, true)
]]
+
+TEST 'number' [[
+local function x(a, ...)
+ return true, 'ss', ...
+end
+local _, _, _, <?b?>, _ = x(nil, true, 1, 'yy')
+]]