summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-23 01:38:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-23 01:38:01 +0800
commit830165b6025107188e564fc4590e5eb633e1a13d (patch)
tree9f02dab4a53528de878e6c936fdf1bfb987fd693 /test/type_inference/init.lua
parent9091e064ab23b6b158551a4d256b65b033cb1688 (diff)
downloadlua-language-server-830165b6025107188e564fc4590e5eb633e1a13d.zip
fix
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 2c17363b..bc497f37 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2981,3 +2981,20 @@ local n1 = f()
local n2 = f(0)
local <?n3?> = f(0, 0)
]]
+
+TEST 'boolean' [[
+---@type {[integer]: boolean, xx: integer}
+local t
+
+local <?n?> = t[1]
+]]
+
+TEST 'boolean' [[
+---@type integer
+local i
+
+---@type {[integer]: boolean, xx: integer}
+local t
+
+local <?n?> = t[i]
+]]