Repository navigation
Commit 8782ce7
committed
fix(identity): give same-file overloads their own node in Java, Kotlin and Swift
A callable QN carries no signature and must be unique, so the overloads of
one class collapsed into one node with the last overload's span. That node
collected the callers of every overload; the others had no callers.
Definitions: once a Java, Kotlin or Swift file's def list is final, each
group of Function/Method defs that share a QN and a label is split. The
first overload by start line keeps the base QN. Each later overload whose
signature no earlier one has takes base QN + the upstream callable_sig
suffix (TYPED; Swift LABELED_TYPED), with qn_sig_off set. Two defs with one
signature (Swift #if twins) keep one QN. A QN that no other callable of the
file shares never changes. Every member carries its parameter shape as the
`overload_params` node property. Members 2..n are registered by QN only, so
every resolver strategy and candidate count stays as before.
Calls: the call site records its argument shape (count, Swift labels,
Kotlin named arguments, trailing closures/lambdas). When a resolved target
belongs to an overload group, both resolvers bind the call to the members
whose parameter shape accepts it, honouring defaults and varargs. When the
shape cannot decide, the call binds to every candidate with strategy
`overload_ambiguous` and confidence at most 0.3, never to one silently.
Argument types are not compared.
The cross-file LSP keeps base QNs for its defs (sig carried separately).
Outgoing calls inside overloads 2..n stay attributed to the base node, as
before. No schema change and no index format bump: an existing index gets
split overloads on its next full index.
Tests: new suite `overloads` (made-up fixtures): matcher cases, extraction
QNs, and Java/Kotlin/Swift callers bound per overload on both resolvers,
plus an ambiguous call bound to both candidates.
Signed-off-by: chidev <[email protected]>1 parent cf70a88 commit 8782ce7
18 files changed
Lines changed: 1476 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
904 | 906 | | |
905 | 907 | | |
906 | 908 | | |
907 | | - | |
| 909 | + | |
908 | 910 | | |
909 | 911 | | |
910 | 912 | | |
| |||
0 commit comments