diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-13 21:54:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-13 21:54:31 +0800 |
commit | 0a3e6482362eb35948cc0c744e089ff491104580 (patch) | |
tree | 5011ecb52a0be0a744f29d0887583359b7411579 /server/src/matcher/vm.lua | |
parent | 2e9cdbe7f0bb48bd5e6321dd968f995913b5da42 (diff) | |
download | lua-language-server-0a3e6482362eb35948cc0c744e089ff491104580.zip |
会根据函数参数推测调用者的类型
Diffstat (limited to 'server/src/matcher/vm.lua')
-rw-r--r-- | server/src/matcher/vm.lua | 6 |
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) |