From 41f0744c4e601ec80e63cce15b6e50f02f6e4a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 11 Jul 2022 17:45:39 +0800 Subject: fix #1320 --- test/type_inference/init.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/type_inference') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 3a24e5d0..de66517d 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3680,3 +3680,26 @@ local t local = t and t[i] ]] + +TEST 'number' [[ +---@type number +local x + +if not .y then + x = nil +end +]] + +TEST 'number' [[ +---@type number|nil +local x +while x == nil do + if x == nil then + return + end + + x = nil +end + +print() +]] -- cgit v1.2.3