summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/common.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index 203bb7b6..2b3104d1 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -1684,6 +1684,23 @@ x = nil
]]
TEST [[
+---@diagnostic disable: unused-local
+
+---@type table
+local x
+
+<!x!> = nil
+]]
+
+TEST [[
+---@diagnostic disable: unused-local
+
+local x
+
+x = nil
+]]
+
+TEST [[
---@diagnostic disable: unused-local, undefined-global
---@type integer
@@ -1780,6 +1797,23 @@ x = x + #t
TEST [[
---@diagnostic disable: unused-local
+local x = 0
+
+x = 1.0
+]]
+
+TEST [[
+---@diagnostic disable: unused-local
+
+---@type integer
+local x = 0
+
+<!x!> = 1.0
+]]
+
+TEST [[
+---@diagnostic disable: unused-local
+
---@class A
---@field x integer
local t