From 2abeaaf81dd8c288a27a2c9638bf5b527ece3463 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 16:19:44 +0800 Subject: fix infers --- test/type_inference/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 3e871499..3a24e5d0 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3666,3 +3666,17 @@ TEST 'unknown' [[ ---@type _, number local , y ]] + +TEST 'number[]' [[ +local t +---@cast t number[]? + +local x = t and [i] +]] + +TEST 'number?' [[ +---@type number[]? +local t + +local = t and t[i] +]] -- cgit v1.2.3