diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 04:26:14 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 04:26:14 +0800 |
commit | 6c82c0f9f83d364fd8965e1c13a3b57aa67f5520 (patch) | |
tree | ee9fe1872fd0c09cd2f9e60e6d23f6a5a2a194ef /test | |
parent | 680ffb800e7fa8f16241407cfb83de0ff38aa0ad (diff) | |
download | lua-language-server-6c82c0f9f83d364fd8965e1c13a3b57aa67f5520.zip |
fix #1463
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/type-check.lua | 9 | ||||
-rw-r--r-- | test/type_inference/init.lua | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 3aeca5d5..383527c2 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -775,6 +775,15 @@ f(1) f(<!3!>) ]] +TEST [[ +local t = { + x = 1, +} + +local x +t[x] = true +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8c18bfb5..03b3a8ae 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3773,3 +3773,13 @@ t.x = t.x print(t.<?x?>) ]] + +TEST 'unknown' [[ +local t = { + x = 1, +} + +local x + +local <?v?> = t[x] +]] |