summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua6
-rw-r--r--test/type_inference/init.lua29
2 files changed, 32 insertions, 3 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 0f96949d..327d72a4 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2580,11 +2580,11 @@ t.GGG$
]]
{
{
- label = 't.GGG',
- kind = define.CompletionItemKind.Enum,
+ label = 'GGG',
+ kind = define.CompletionItemKind.Field,
},
{
- label = 't.GGG()',
+ label = 'GGG()',
kind = define.CompletionItemKind.Function,
},
}
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)
+]]