summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-30 12:38:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-30 12:38:03 +0800
commit02f6831344efd3a32c0ac8a1fbd0d00af3dec671 (patch)
treecee8015a49eebd4da3238ff7c010beea516f3066 /test
parentf5d631b87b38a54b8cb40dec602a7f1910fe7e4f (diff)
downloadlua-language-server-02f6831344efd3a32c0ac8a1fbd0d00af3dec671.zip
fix wrong infer of tableindex
#1831
Diffstat (limited to 'test')
-rw-r--r--test/hover/init.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua
index a3741764..7521ddf4 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -2430,3 +2430,20 @@ local t: {
['y']: integer = 2,
}
]]
+
+TEST [[
+local enum = { a = 1, b = 2 }
+
+local <?t?> = {
+ [enum.a] = true,
+ [enum.b] = 2,
+ [3] = {}
+}
+]]
+[[
+local t: {
+ [1]: boolean = true,
+ [2]: integer = 2,
+ [3]: table,
+}
+]]