summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-23 03:32:57 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-23 03:32:57 +0800
commit420812ce4e77ff4143437b2893dd77fc729c7622 (patch)
tree92293fc9ab871147060130e432819ea3c3e6f6b9 /test/type_inference/init.lua
parent838ce36fdd7abdff0b4cab5e67c2500325178805 (diff)
downloadlua-language-server-420812ce4e77ff4143437b2893dd77fc729c7622.zip
update
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index bca3a546..434307a2 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3016,3 +3016,30 @@ if type(x) == 'number' then
print(<?x?>)
end
]]
+
+TEST 'boolean' [[
+---@class A
+---@field [integer] boolean
+local mt
+
+function mt:f()
+ ---@type integer
+ local index
+ local <?x?> = self[index]
+end
+]]
+
+TEST 'boolean' [[
+---@class A
+---@field [B] boolean
+
+---@class B
+
+---@type A
+local a
+
+---@type B
+local b
+
+local <?x?> = a[b]
+]]