From 834d5e70092d38c884b23fe2bc176ed06f362c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 14 Jul 2021 21:02:33 +0800 Subject: resolve #588 --- test/definition/table.lua | 6 ++++++ test/hover/init.lua | 28 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/definition/table.lua b/test/definition/table.lua index ba2d2aa3..d63cc655 100644 --- a/test/definition/table.lua +++ b/test/definition/table.lua @@ -157,3 +157,9 @@ end local t = f() t.field1. ]] + +TEST [[ +local t = { } + +print(t[]) +]] diff --git a/test/hover/init.lua b/test/hover/init.lua index 80f6009c..18482de5 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -818,7 +818,11 @@ local = { } ]] [[ -local t: {} +local t: { + [1]: string = "aaa", + [2]: string = "bbb", + [3]: string = "ccc", +} ]] TEST [[ @@ -1638,3 +1642,25 @@ global a.b: { c: integer, } ]] + +TEST [[ +local = { + 'a', 'b', 'c', + [10] = 'd', + x = 'e', + y = 'f', + ['z'] = 'g', + [3] = 'h', +} +]] +[[ +local t: { + x: string = "e", + y: string = "f", + z: string = "g", + [1]: string = "a", + [2]: string = "b", + [3]: string = "c"|"h", + [10]: string = "d", +} +]] -- cgit v1.2.3