summaryrefslogtreecommitdiff
path: root/test/signature
diff options
context:
space:
mode:
Diffstat (limited to 'test/signature')
-rw-r--r--test/signature/init.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/signature/init.lua b/test/signature/init.lua
index 147f93e1..f46ce017 100644
--- a/test/signature/init.lua
+++ b/test/signature/init.lua
@@ -330,3 +330,45 @@ t(<??>)
{
'function (<!x: number!>)',
}
+
+TEST [[
+---@class 😅
+
+---@param a 😅
+---@param b integer
+local function f(a, b)
+end
+
+f(1, 2<??>)
+]]
+{
+'function f(a: 😅, <!b: integer!>)',
+}
+
+TEST [[
+---@class A
+---@field event fun(self: self, ev: "onChat", c: string)
+---@field event fun(self: self, ev: "onTimer", t: integer)
+
+---@type A
+local t
+
+t:event("onChat", <??>)
+]]
+{
+'(method) (ev: "onChat", <!c: string!>)',
+}
+
+TEST [[
+---@class A
+---@field event fun(self: self, ev: "onChat", c: string)
+---@field event fun(self: self, ev: "onTimer", t: integer)
+
+---@type A
+local t
+
+t:event("onTimer", <??>)
+]]
+{
+'(method) (ev: "onTimer", <!t: integer!>)',
+}