diff options
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 23 |
1 files changed, 23 insertions, 0 deletions
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 <?x?> = t and t[i] ]] + +TEST 'number' [[ +---@type number +local x + +if not <?x?>.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(<?x?>) +]] |