summaryrefslogtreecommitdiff
path: root/test/diagnostics/type-check.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-03-22 17:57:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-03-22 17:57:59 +0800
commit91ae26be49374dee87d09f0fe9160cb393e4fef7 (patch)
tree6ac7d2ee8b984a6f23829a24ff8870460d0e1172 /test/diagnostics/type-check.lua
parentb8627365c0abe5a9d40c91f81b2aef7ea869faad (diff)
downloadlua-language-server-91ae26be49374dee87d09f0fe9160cb393e4fef7.zip
recover mark before return
fix #2004
Diffstat (limited to 'test/diagnostics/type-check.lua')
-rw-r--r--test/diagnostics/type-check.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua
index 4abe5855..18e7190d 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -1238,6 +1238,23 @@ local arr2 = {
}
]]
+TEST [[
+---@class A
+
+---@class B : A
+
+---@class C : B
+
+---@class D : B
+
+---@param x A
+local function func(x) end
+
+---@type C|D
+local var
+func(var)
+]]
+
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')