File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 33## Unreleased
44<!-- Add all new changes here. They will be moved under a version at release -->
55
6+ ## 3.10.1
7+ * ` FIX ` Runtime error
8+
69## 3.10.0
710` 2024-8-1 `
811* ` NEW ` Add postfix snippet for ` unpack `
Original file line number Diff line number Diff line change @@ -578,7 +578,17 @@ local function matchCall(source)
578578 if call .args then
579579 -- clear node caches of args to allow recomputation with the type narrowed call
580580 for _ , arg in ipairs (call .args ) do
581- vm .removeNode (arg )
581+ vm .setNode (arg , vm .createNode (), true )
582+ end
583+ for n in newNode :eachObject () do
584+ if n .type == ' function'
585+ or n .type == ' doc.type.function' then
586+ for i , arg in ipairs (call .args ) do
587+ if n .args [i ] then
588+ vm .setNode (arg , vm .compileNode (n .args [i ]))
589+ end
590+ end
591+ end
582592 end
583593 end
584594 end
Original file line number Diff line number Diff line change @@ -137,3 +137,27 @@ local function f(...) end
137137
138138local <?r?> = f(10)
139139]]
140+
141+ TEST ' number' [[
142+ ---@overload fun(a: 1, c: fun(x: number))
143+ ---@overload fun(a: 2, c: fun(x: string))
144+ local function f(...) end
145+
146+ f(1, function (<?a?>) end)
147+ ]]
148+
149+ TEST ' string' [[
150+ ---@overload fun(a: 1, c: fun(x: number))
151+ ---@overload fun(a: 2, c: fun(x: string))
152+ local function f(...) end
153+
154+ f(2, function (<?a?>) end)
155+ ]]
156+
157+ TEST ' any' [[
158+ ---@overload fun(a: 1)
159+ ---@overload fun(a: 2)
160+ local function f(...) end
161+
162+ f(1, function (<?a?>) end)
163+ ]]
You can’t perform that action at this time.
0 commit comments