From 98fe538e564bac10e5df65c31e20b8dc3317e87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 15 Jun 2022 15:25:38 +0800 Subject: fix --- test/type_inference/init.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'test') 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 ]] + +TEST 'table' [[ +---@type table|nil +local t + +while t do + print() +end +]] + +TEST 'table|nil' [[ +---@type table|nil +local t + +while do + print(t) +end +]] + +TEST 'table' [[ +---@type table|nil +local t + +while t ~= nil do + print() +end +]] + +TEST 'table|nil' [[ +---@type table|nil +local t + +while ~= nil do + print(t) +end +]] -- cgit v1.2.3