diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 36 |
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 +]] |