diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-11-06 23:35:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-11-06 23:35:34 +0800 |
commit | 885013052b8ad1f5d736a26212fc5926b228c020 (patch) | |
tree | a472eb3740eeae0b91ebc603153e736dd054d69a /test | |
parent | fe5eb506a4aef026fd92f0ee6ce3290fdceaab61 (diff) | |
download | lua-language-server-885013052b8ad1f5d736a26212fc5926b228c020.zip |
type check: supports array part in literal table
resolve #1374
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/type-check.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index f6b8f008..5f10856d 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -942,6 +942,20 @@ local function bar(opts) end ]] +TEST [[ +---@type {[1]: string, [10]: number, xx: boolean} +local t = { + <!true!>, + <![10]!> = 's', + <!xx!> = 1, +} +]] + +TEST [[ +---@type boolean[] +local t = { <!1!>, <!2!>, <!3!> } +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') |