diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 17:44:51 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 17:44:51 +0800 |
commit | 1abbbdc89bb5511aead3ac8155ae68265b90a6e9 (patch) | |
tree | 37458759e015edcf0e9650df0fcb1155978c44ed /script/vm/compiler.lua | |
parent | 09f1cf4e0380437087536ec0d79eddae44a0e569 (diff) | |
download | lua-language-server-1abbbdc89bb5511aead3ac8155ae68265b90a6e9.zip |
some fix
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r-- | script/vm/compiler.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 103239c1..dd41d7b6 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -641,7 +641,12 @@ local function compileByLocalID(source) if src.value then if not hasMarkDoc or guide.isLiteral(src.value) then if src.value.type ~= 'nil' then - vm.setNode(source, vm.compileNode(src.value)) + local valueNode = vm.compileNode(src.value) + if valueNode:hasType 'unknown' then + vm.setNode(source, valueNode:copy():remove 'unknown') + else + vm.setNode(source, valueNode) + end end end end @@ -1296,6 +1301,7 @@ local compilerSwitch = util.switch() return end compileByLocalID(source) + ---@type string|vm.node local key = guide.getKeyName(source) if key == nil and source.index then key = vm.compileNode(source.index) |