File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed
Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,32 @@ let addFunctionReference ~config ~decls ~cross_file ~(locFrom : Location.t)
1313 the declaration site that should receive warnings. *)
1414 let shouldAdd =
1515 if posTo.pos_fname <> posFrom.pos_fname then
16- match Declarations. find_opt_builder decls posTo with
17- | Some {declKind = Value {ownsOptionalArgs; optionalArgs} } ->
18- ownsOptionalArgs && not (OptionalArgs. isEmpty optionalArgs)
19- | _ -> false
16+ if
17+ fileIsImplementationOf posTo.pos_fname posFrom.pos_fname
18+ || fileIsImplementationOf posFrom.pos_fname posTo.pos_fname
19+ then
20+ match Declarations. find_opt_builder decls posTo with
21+ | Some {declKind = Value {ownsOptionalArgs; optionalArgs} } ->
22+ ownsOptionalArgs && not (OptionalArgs. isEmpty optionalArgs)
23+ | _ -> false
24+ else
25+ match
26+ ( Declarations. find_opt_builder decls posFrom,
27+ Declarations. find_opt_builder decls posTo )
28+ with
29+ | ( Some
30+ {
31+ declKind =
32+ Value {ownsOptionalArgs = true ; optionalArgs = sourceArgs};
33+ },
34+ Some
35+ {
36+ declKind =
37+ Value {ownsOptionalArgs = true ; optionalArgs = targetArgs};
38+ } ) ->
39+ not (OptionalArgs. isEmpty sourceArgs)
40+ && not (OptionalArgs. isEmpty targetArgs)
41+ | _ -> false
2042 else
2143 match
2244 ( Declarations. find_opt_builder decls posFrom,
You can’t perform that action at this time.
0 commit comments