summaryrefslogtreecommitdiff
path: root/test/diagnostics/type-check.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-30 20:20:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-30 20:20:28 +0800
commitb93e0756cc07d9188a8047438f502ff296d5ec66 (patch)
treea2de65273f09cba6e516c54d513296e82bfb9a62 /test/diagnostics/type-check.lua
parent76b8cf3236db2efc7f73f3508212d99199b73b52 (diff)
downloadlua-language-server-b93e0756cc07d9188a8047438f502ff296d5ec66.zip
copy nodes when tracing list
fix #1841
Diffstat (limited to 'test/diagnostics/type-check.lua')
-rw-r--r--test/diagnostics/type-check.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua
index 7882df69..8f3d6936 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -1180,6 +1180,16 @@ local x
- 类型 `nil` 无法匹配 `'A'`]])
end)
+TEST [[
+---@param v integer
+---@return boolean
+local function is_string(v)
+ return type(v) == 'string'
+end
+
+print(is_string(3))
+]]
+
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')