summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-16 21:19:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-16 21:19:32 +0800
commita1f966af7db434c5dc7b2423ae63f4fe21957b46 (patch)
treead0c8a29aa780d9c1ae1e4afb7563e90c09ee65b /test/diagnostics
parentb1d96627a1af5e4485720636dfb1d4f767e184d5 (diff)
downloadlua-language-server-a1f966af7db434c5dc7b2423ae63f4fe21957b46.zip
can set `table` or `class` to `nil`
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/common.lua19
1 files changed, 19 insertions, 0 deletions
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
+]]