diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-28 16:28:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-28 16:28:33 +0800 |
commit | df4fb9b5157cbf11f3fc5f6041afef657f0acfba (patch) | |
tree | 84f65cb0adff35c8e2563d321dc99530010c5a6b /script/vm/compiler.lua | |
parent | 7de3d6851a41d993b1f84eddd3331067a82e8878 (diff) | |
download | lua-language-server-df4fb9b5157cbf11f3fc5f6041afef657f0acfba.zip |
diag `missing-return`
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r-- | script/vm/compiler.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index b2cdb1be..f42a4768 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -492,6 +492,7 @@ function vm.getReturnOfFunction(func, index) end return vm.createGeneric(rtn, sign) end + return nil end ---@return vm.node @@ -976,7 +977,6 @@ local function compileForVars(source) end ---@param source parser.object ----@return vm.node local function compileLocal(source) vm.setNode(source, source) @@ -1077,7 +1077,7 @@ local binarySwich = util.switch() : call(function (source) local node1 = vm.compileNode(source[1]) local node2 = vm.compileNode(source[2]) - local r1 = vm.test(source[1]) + local r1 = vm.testCondition(source[1]) if r1 == true then vm.setNode(source, node2) elseif r1 == false then @@ -1090,7 +1090,7 @@ local binarySwich = util.switch() : call(function (source) local node1 = vm.compileNode(source[1]) local node2 = vm.compileNode(source[2]) - local r1 = vm.test(source[1]) + local r1 = vm.testCondition(source[1]) if r1 == true then vm.setNode(source, node1) elseif r1 == false then @@ -1784,7 +1784,7 @@ local compilerSwitch = util.switch() return end if source.op.type == 'not' then - local result = vm.test(source[1]) + local result = vm.testCondition(source[1]) if result == nil then vm.setNode(source, vm.declareGlobal('type', 'boolean')) return |