summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-20 22:50:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-20 22:50:39 +0800
commitf629e481de53bbfac24ebae5c952bb80e3300d47 (patch)
tree29be92fae9205ffa97dfc6f1b405f67f4017a574 /script/vm
parent28d5a33077b28dcbb52974aaf90125cee013342b (diff)
downloadlua-language-server-f629e481de53bbfac24ebae5c952bb80e3300d47.zip
update
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/infer.lua3
-rw-r--r--script/vm/node.lua2
2 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index e0ab90bb..f7ff2569 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -173,6 +173,9 @@ local viewNodeSwitch = util.switch()
return ('fun(%s)%s'):format(argView, regView)
end)
+---@class vm.node
+---@field lastInfer? vm.infer
+
---@param source parser.object | vm.node
---@return vm.infer
function vm.getInfer(source)
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 26f8e761..9433733e 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -14,7 +14,6 @@ mt.__index = mt
mt.id = 0
mt.type = 'vm.node'
mt.optional = nil
-mt.lastInfer = nil
mt.data = nil
---@param node vm.node | vm.object
@@ -310,6 +309,7 @@ function vm.setNode(source, node, cover)
error('Can not set node to global')
end
if cover then
+ ---@cast node vm.node
vm.nodeCache[source] = node
return
end