From 25cae7df6bff76e6a44adf85dfef06742ebf7193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 6 Jul 2022 16:01:05 +0800 Subject: dose not infer as `nil` by `t.field = nil` --- script/vm/compiler.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script/vm') 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 -- cgit v1.2.3