File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,7 @@ local function compileFunctionParam(func, source)
10991099
11001100 -- local call ---@type fun(f: fun(x: number));call(function (x) end) --> x -> number
11011101 local funcNode = vm .compileNode (func )
1102+ local found = false
11021103 for n in funcNode :eachObject () do
11031104 if n .type == ' doc.type.function' and n .args [aindex ] then
11041105 local argNode = vm .compileNode (n .args [aindex ])
@@ -1107,9 +1108,16 @@ local function compileFunctionParam(func, source)
11071108 vm .setNode (source , an )
11081109 end
11091110 end
1110- return true
1111+ -- NOTE: keep existing behavior for local call which only set type based on the 1st match
1112+ if func .parent .type == ' callargs' then
1113+ return true
1114+ end
1115+ found = true
11111116 end
11121117 end
1118+ if found then
1119+ return true
1120+ end
11131121
11141122 local derviationParam = config .get (guide .getUri (func ), ' Lua.type.inferParamType' )
11151123 if derviationParam and func .parent .type == ' local' and func .parent .ref then
You can’t perform that action at this time.
0 commit comments