summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
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)
+]]