diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-08-02 16:33:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-08-02 16:33:06 +0800 |
commit | 8ecec087ee48501252699b2759b00056db6ef298 (patch) | |
tree | fa7580d5ee7fa3c39e3771d73d0912c6c7e6e137 /test/type_inference | |
parent | bf69b7c7f6875559e988868c2f2a46d5c670f690 (diff) | |
download | lua-language-server-8ecec087ee48501252699b2759b00056db6ef298.zip |
fix runtime error
fix #2776
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/param_match.lua | 24 |
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) +]] |