summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-09 00:09:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-09 00:09:13 +0800
commit679b32f9ad2999fb71fef335ce48b9a909f9937d (patch)
tree17f0de84e3f8026ba25b193f7d54eabe0f3e0b24 /test/type_inference
parent4d73939b6ec2320f72b35e1e193b8bf1fb18f64c (diff)
downloadlua-language-server-679b32f9ad2999fb71fef335ce48b9a909f9937d.zip
fix #1677
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 6032cd0f..40f9891d 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3947,3 +3947,21 @@ end
local <?x?> = f(true)
]]
+
+TEST 'number' [[
+---@class A
+---@field [1] number
+---@field [2] boolean
+local t
+
+local <?n?> = t[1]
+]]
+
+TEST 'boolean' [[
+---@class A
+---@field [1] number
+---@field [2] boolean
+local t
+
+local <?n?> = t[2]
+]]