summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-27 00:42:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-27 00:42:31 +0800
commit92b2a185af2d31dd353ef8a7d57469ee9d584cb7 (patch)
tree6bf05537370f6aae25e956f927773e95ad229b07 /test/diagnostics
parentc50a20ddad4adb3e0f8ead37a2e6a9960fe3000d (diff)
downloadlua-language-server-92b2a185af2d31dd353ef8a7d57469ee9d584cb7.zip
resolve #1236 custom class can extends basic class
Diffstat (limited to 'test/diagnostics')
-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 711211e8..34f7a492 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -479,5 +479,22 @@ n = nb
]]
config.set(nil, 'Lua.type.weakUnionCheck', false)
+TEST [[
+---@class Option: string
+
+---@param x Option
+local function f(x) end
+
+---@type Option
+local x = 'aaa'
+
+f(x)
+]]
+
+TEST [[
+---@type number
+local <!x!> = 'aaa'
+]]
+
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')