diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-30 14:38:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-30 14:38:08 +0800 |
commit | c69e65f5468a3aff99f1de11ee7c72a0d9f75afe (patch) | |
tree | 225053bed8d7c4c6af6314c2f88de85cad544055 /test | |
parent | 02f6831344efd3a32c0ac8a1fbd0d00af3dec671 (diff) | |
download | lua-language-server-c69e65f5468a3aff99f1de11ee7c72a0d9f75afe.zip |
infer types of tableindex by semantic
fix #1831
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/type-check.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 908920b9..ba0c78b4 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -1117,6 +1117,17 @@ local B = "World" local x = A ]] +TEST [[ +local enum = { a = 1, b = 2 } + +---@type { [integer] : boolean } +local t = { + <![enum.a]!> = 1, + <![enum.b]!> = 2, + <![3]!> = 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') |