summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-07-06 19:00:02 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-07-06 19:00:02 +0800
commit73dff6a786af49fca7451fc9a988517d114f44c0 (patch)
treea22ddcf870de39b77cd417aa49de45a119e9b0d8 /test
parent764cc62a17af3cea9db5ae8bc695c9b9230841ac (diff)
downloadlua-language-server-73dff6a786af49fca7451fc9a988517d114f44c0.zip
signature: narrow by inputed literal
Diffstat (limited to 'test')
-rw-r--r--test/signature/init.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/signature/init.lua b/test/signature/init.lua
index 4089bd2e..f46ce017 100644
--- a/test/signature/init.lua
+++ b/test/signature/init.lua
@@ -344,3 +344,31 @@ 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!>)',
+}