summaryrefslogtreecommitdiff
path: root/server/src/matcher/vm.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-13 21:54:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-13 21:54:31 +0800
commit0a3e6482362eb35948cc0c744e089ff491104580 (patch)
tree5011ecb52a0be0a744f29d0887583359b7411579 /server/src/matcher/vm.lua
parent2e9cdbe7f0bb48bd5e6321dd968f995913b5da42 (diff)
downloadlua-language-server-0a3e6482362eb35948cc0c744e089ff491104580.zip
会根据函数参数推测调用者的类型
Diffstat (limited to 'server/src/matcher/vm.lua')
-rw-r--r--server/src/matcher/vm.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua
index 2f7bbcf4..af3e00ed 100644
--- a/server/src/matcher/vm.lua
+++ b/server/src/matcher/vm.lua
@@ -325,7 +325,11 @@ function mt:setFunctionArg(func, values)
func.argValues = {}
end
for i = 1, #values do
- func.argValues[i] = values[i]
+ if not func.argValues[i] then
+ func.argValues[i] = values[i]
+ end
+ self:inference(values[i], func.argValues[i].type)
+ self:inference(func.argValues[i], values[i].type)
end
self:updateFunctionArgs(func)