summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-22 13:31:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-22 13:31:30 +0800
commit9313b06d5c6558dca5d0ece8967c84fbab12543c (patch)
treef3588643c441ed3bcf0b35c79a4f47e0c8b5531c /test/type_inference/init.lua
parent65566ae751f77fabdd5b7d8aa985c3529d3800df (diff)
parent3db634a3a2e48a97772065e7e9da4d29a07a8098 (diff)
downloadlua-language-server-9313b06d5c6558dca5d0ece8967c84fbab12543c.zip
Merge branch 'bugfix'
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 871b4ef8..b48d0700 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -926,6 +926,17 @@ TEST 'integer' [[
--- @field on fun(eventName: '"won"', cb: fun(s: string))
local emit = {}
+emit.on("died", function (<?i?>)
+end)
+]]
+
+TEST 'integer' [[
+--- @class Emit
+--- @field on fun(self: Emit, eventName: string, cb: function)
+--- @field on fun(self: Emit, eventName: '"died"', cb: fun(i: integer))
+--- @field on fun(self: Emit, eventName: '"won"', cb: fun(s: string))
+local emit = {}
+
emit:on("died", function (<?i?>)
end)
]]
@@ -997,3 +1008,14 @@ TEST 'Test' [[
---@class Test
_G.<?Test?> = {}
]]
+
+TEST 'integer' [[
+local mt = {}
+
+---@param callback fun(i: integer)
+function mt:loop(callback) end
+
+mt:loop(function (<?i?>)
+
+end)
+]]