summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/type-check.lua14
1 files changed, 14 insertions, 0 deletions
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 <!number!>
]]
+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')