summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-06 16:01:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-06 16:01:05 +0800
commit25cae7df6bff76e6a44adf85dfef06742ebf7193 (patch)
tree8606dc8bf2d7c539206f66ee888f24cdac3c7b3c /script/vm
parenteca994d10e4f069a4cc9348d27a4f3723a19f551 (diff)
downloadlua-language-server-25cae7df6bff76e6a44adf85dfef06742ebf7193.zip
dose not infer as `nil` by `t.field = nil`
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 67ca3b41..12cf102b 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1387,7 +1387,7 @@ local compilerSwitch = util.switch()
if src.value then
if bindDocs(src) then
vm.setNode(source, vm.compileNode(src))
- else
+ elseif src.value.type ~= 'nil' then
vm.setNode(source, vm.compileNode(src.value))
local node = vm.getNode(src)
if node then
@@ -1949,7 +1949,7 @@ local function compileByGlobal(source)
vm.setNode(set, globalNode, true)
end
for _, set in ipairs(global:getSets(uri)) do
- if set.value then
+ if set.value and set.value.type ~= 'nil' then
if not hasMarkDoc or guide.isLiteral(set.value) then
globalNode:merge(vm.compileNode(set.value))
end