summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-02 17:20:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-02 17:20:28 +0800
commit9a25855cee5238a870f366a2f9d096142b72cd5a (patch)
treef9d6dff6a4aa6d13109c0c9c3f0b77fcf9c98882 /test/type_inference
parent0ba04868b6bed5c213cb0f7e3d732ce59bf930f0 (diff)
downloadlua-language-server-9a25855cee5238a870f366a2f9d096142b72cd5a.zip
reslove #460
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 3ec1cf19..3df73863 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -828,6 +828,13 @@ TEST 'fun():number, boolean' [[
local <?t?>
]]
+--[[
+l:value
+l:work|&1|&1
+f:|&1|&1
+dfun:|&1
+dn:Class
+]]
TEST 'Class' [[
---@class Class
@@ -838,3 +845,25 @@ end
work(function (<?value?>)
end)
]]
+
+TEST 'Class' [[
+---@class Class
+
+---@param callback fun(value: Class)
+function work(callback)
+end
+
+pcall(work, function (<?value?>)
+end)
+]]
+
+TEST 'Class' [[
+---@class Class
+
+---@param callback fun(value: Class)
+function work(callback)
+end
+
+xpcall(work, debug.traceback, function (<?value?>)
+end)
+]]