File tree 3 files changed +38
-1
lines changed
3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 3
3
## Unreleased
4
4
<!-- Add all new changes here. They will be moved under a version at release -->
5
5
6
+ ## 3.10.1
7
+ * ` FIX ` Runtime error
8
+
6
9
## 3.10.0
7
10
` 2024-8-1 `
8
11
* ` NEW ` Add postfix snippet for ` unpack `
Original file line number Diff line number Diff line change @@ -578,7 +578,17 @@ local function matchCall(source)
578
578
if call .args then
579
579
-- clear node caches of args to allow recomputation with the type narrowed call
580
580
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
582
592
end
583
593
end
584
594
end
Original file line number Diff line number Diff line change @@ -137,3 +137,27 @@ local function f(...) end
137
137
138
138
local <?r?> = f(10)
139
139
]]
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