diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-23 19:16:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-23 19:16:10 +0800 |
commit | d38838450ffe2962acbe63836ecad76eb6adaa2f (patch) | |
tree | 888558c3cfdc44e427e0f558d071897e38368f18 /script | |
parent | 2873ccae1dfb1d429a84262f10c87f1d437135c6 (diff) | |
download | lua-language-server-d38838450ffe2962acbe63836ecad76eb6adaa2f.zip |
Revert "infer parameter type by return"
This reverts commit 2873ccae1dfb1d429a84262f10c87f1d437135c6.
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/compiler.lua | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 599b2c4a..ad1379fc 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1059,7 +1059,6 @@ local function compileLocal(source) end if source.parent.type == 'funcargs' and not hasMarkDoc and not hasMarkParam then local func = source.parent.parent - -- local call ---@type fun(f: fun(x: number));call(function (x) end) --> x -> number local funcNode = vm.compileNode(func) local hasDocArg for n in funcNode:eachObject() do @@ -1159,22 +1158,6 @@ local compilerSwitch = util.switch() local call = source.parent.parent vm.compileCallArg(source, call) end - - -- function f() return function (<?x?>) end end - if source.parent.type == 'return' then - for i, ret in ipairs(source.parent) do - if ret == source then - local func = guide.getParentFunction(source.parent) - if func then - local returnObj = vm.getReturnOfFunction(func, i) - if returnObj then - vm.setNode(source, vm.compileNode(returnObj)) - end - end - break - end - end - end end) : case 'paren' : call(function (source) |