summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 18:31:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 18:31:50 +0800
commit9e8ae91901c096be13e6c7ef0cf865b0be7d0538 (patch)
tree154c1db2cf1209a7a84ba68889b10f90f260b428 /test
parentd10eb1c80d40fe2b511a594888586862e69c6a35 (diff)
downloadlua-language-server-9e8ae91901c096be13e6c7ef0cf865b0be7d0538.zip
fix
Diffstat (limited to 'test')
-rw-r--r--test/hover/init.lua12
-rw-r--r--test/type_inference/init.lua15
2 files changed, 27 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 2ae6837f..4337c4a4 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -1816,3 +1816,15 @@ local <?x?> = '1' .. '2'
[[
local x: string = "12"
]]
+
+TEST [[
+local t = {
+ x = 1,
+ [1] = 'x',
+}
+
+local <?x?> = t[#t]
+]]
+[[
+local x: string = "x"
+]]
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index bad1a876..4d1cfb4a 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1419,3 +1419,18 @@ local t = {
local <?x?> = t[#t]
]]
+
+TEST 'string' [[
+local t = {
+ x = 1,
+ [1] = 'x',
+}
+
+local <?x?> = t[#t]
+]]
+
+TEST 'string' [[
+local t = { 'x' }
+
+local <?x?> = t[#t]
+]]