From 0ff98557a45c25d7a49520e57f49561a62300f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 23 Jun 2022 02:45:02 +0800 Subject: update --- test/diagnostics/type-check.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/diagnostics') diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index afd0a5b6..6b2c522f 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -366,5 +366,19 @@ local t ---@cast t ]] +TEST [[ +local n + +if G then + n = {} +else + n = nil +end + +local t = { + x = n, +} +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') -- cgit v1.2.3