summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-08-02 16:33:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-08-02 16:33:06 +0800
commit8ecec087ee48501252699b2759b00056db6ef298 (patch)
treefa7580d5ee7fa3c39e3771d73d0912c6c7e6e137 /test/type_inference
parentbf69b7c7f6875559e988868c2f2a46d5c670f690 (diff)
downloadlua-language-server-8ecec087ee48501252699b2759b00056db6ef298.zip
fix runtime error
fix #2776
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/param_match.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/type_inference/param_match.lua b/test/type_inference/param_match.lua
index 8ead05ef..1079e433 100644
--- a/test/type_inference/param_match.lua
+++ b/test/type_inference/param_match.lua
@@ -137,3 +137,27 @@ local function f(...) end
local <?r?> = f(10)
]]
+
+TEST 'number' [[
+---@overload fun(a: 1, c: fun(x: number))
+---@overload fun(a: 2, c: fun(x: string))
+local function f(...) end
+
+f(1, function (<?a?>) end)
+]]
+
+TEST 'string' [[
+---@overload fun(a: 1, c: fun(x: number))
+---@overload fun(a: 2, c: fun(x: string))
+local function f(...) end
+
+f(2, function (<?a?>) end)
+]]
+
+TEST 'any' [[
+---@overload fun(a: 1)
+---@overload fun(a: 2)
+local function f(...) end
+
+f(1, function (<?a?>) end)
+]]