summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-15 15:25:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-15 15:25:38 +0800
commit98fe538e564bac10e5df65c31e20b8dc3317e87d (patch)
tree08fa752ef06ed64c7bfe7358115e1bc6fb6e4b85 /test
parented2fd90278a6e913186ddfbbb8939733c640102b (diff)
downloadlua-language-server-98fe538e564bac10e5df65c31e20b8dc3317e87d.zip
fix
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index ecc22a3f..0a19082a 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2512,3 +2512,39 @@ TEST 'fun(x: fun(x: unknown))' [[
---@type xxx
local <?t?>
]]
+
+TEST 'table' [[
+---@type table|nil
+local t
+
+while t do
+ print(<?t?>)
+end
+]]
+
+TEST 'table|nil' [[
+---@type table|nil
+local t
+
+while <?t?> do
+ print(t)
+end
+]]
+
+TEST 'table' [[
+---@type table|nil
+local t
+
+while t ~= nil do
+ print(<?t?>)
+end
+]]
+
+TEST 'table|nil' [[
+---@type table|nil
+local t
+
+while <?t?> ~= nil do
+ print(t)
+end
+]]