summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-25 20:13:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-25 20:13:42 +0800
commit2c6f0f9bf83f9a44c466aaf0d45ed9f8eab6c117 (patch)
tree96b11b2863b0a1e10158e6ad6cc5df3b8fb74716 /test/type_inference/init.lua
parent7b809496a5a4be6a182d715b264493cb39c98674 (diff)
downloadlua-language-server-2c6f0f9bf83f9a44c466aaf0d45ed9f8eab6c117.zip
resolve #1226
semicolons and parentheses can be used in `DocTable`
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 434307a2..8cf98da5 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3043,3 +3043,24 @@ local b
local <?x?> = a[b]
]]
+
+TEST 'number' [[
+---@type {x: string ; y: boolean; z: number}
+local t
+
+local <?z?> = t.z
+]]
+
+TEST 'fun():number, boolean' [[
+---@type {f: fun():number, boolean}
+local t
+
+local <?f?> = t.f
+]]
+
+TEST 'fun():number' [[
+---@type {(f: fun():number), x: boolean}
+local t
+
+local <?f?> = t.f
+]]