summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-11 18:24:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-11 18:24:34 +0800
commit90b95a06eb43b469f53c147509a4d67e1c567fb5 (patch)
treeb20d2a57c13e41c6e7afd09a9043ede1ee787411 /script/vm
parentf5fcab05b5a30373d1b35689d456090c8299c4c2 (diff)
downloadlua-language-server-90b95a06eb43b469f53c147509a4d67e1c567fb5.zip
local uses `nil` at least
fix #2155
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 7faa4f47..7d10561e 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1112,6 +1112,12 @@ local function compileLocal(source)
end
end
+ if source.value
+ and source.value.type == 'nil'
+ and not myNode:hasKnownType() then
+ vm.setNode(source, vm.compileNode(source.value))
+ end
+
myNode.hasDefined = hasMarkDoc or hasMarkParam or hasMarkValue
end