From a1f966af7db434c5dc7b2423ae63f4fe21957b46 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, 16 Jun 2022 21:19:32 +0800 Subject: can set `table` or `class` to `nil` --- test/diagnostics/common.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/diagnostics') diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index b5f490a2..f80aee0a 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1644,3 +1644,22 @@ local x x = 1 ]] + +TEST [[ +---@diagnostic disable: unused-local + +local x = {} + +x = nil +]] + +TEST [[ +---@diagnostic disable: unused-local + +---@class A + +---@type A +local x + +x = nil +]] -- cgit v1.2.3