summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-02 15:51:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-02 15:51:24 +0800
commit3bf48c900605681216ce7c14cfe0cb43e583de4f (patch)
tree6bbea2d1f3455072de6c7f6418e24cca27d518d2 /script/vm/compiler.lua
parentdd972c9071f9dd61550c1ce15cc3f9a6a2b08634 (diff)
downloadlua-language-server-3bf48c900605681216ce7c14cfe0cb43e583de4f.zip
infer parameter type when function in table
resolve #1332
Diffstat (limited to 'script/vm/compiler.lua')
-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 52f1083b..03a34dbd 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1108,6 +1108,12 @@ local compilerSwitch = util.switch()
end
end
end
+
+ -- { f = function (<?x?>) end }
+ if source.parent.type == 'tablefield'
+ or source.parent.type == 'tableindex' then
+ vm.setNode(source, vm.compileNode(source.parent))
+ end
end)
: case 'paren'
: call(function (source)