Skip to content

fix(apex): emit extends edges for interface multiple inheritance#1645

Closed
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/apex-interface-extends-edges
Closed

fix(apex): emit extends edges for interface multiple inheritance#1645
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/apex-interface-extends-edges

Conversation

@Synvoya

@Synvoya Synvoya commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What it fixes

An Apex interface X extends A, B emitted only a contains edge — the parent interface list was dropped from the graph.

iface_re captures the extends parent list in group 2, but the interface handler read only group 1 (the interface name); group 2 was never used. (The class branch already splits its parent list and emits an edge per parent.)

Fix

After the interface node / contains edge, iterate the captured parent list and emit one extends edge per parent, mirroring the class branch's node resolution (extends matches the keyword Apex interfaces use for inheritance; the class branch already emits extends). Apex interfaces support multiple inheritance.

public interface PaymentProcessor extends Processor, Auditable { void process(); }

now emits:

extends: PaymentProcessor -> Processor
extends: PaymentProcessor -> Auditable

Test

  • tests/test_languages.py: test_apex_interface_extends asserts both parents appear as inheritance edges.
  • pytest tests/test_languages.py -k apex → 13 passed (negative control without the fix fails with an empty inheritance set).

interface X extends A, B captured the parent list in iface_re group 2 but the handler only read group 1, so no inheritance edge was emitted. Split the parent list and emit one extends edge per parent (mirroring the class branch).
safishamsi added a commit that referenced this pull request Jul 4, 2026
…delegation)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@safishamsi

Copy link
Copy Markdown
Collaborator

Merged into v8 as 53c769d, with your authorship preserved (ships in 0.9.6). Thanks @Synvoya.

Clean fix — the interface handler was reading only group 1 while group 2 already captured the parent list, and your addition mirrors the class branch's parent resolution exactly (same stem/bare _make_id fallback and INFERRED confidence). The negative-control note on the test was appreciated.

@safishamsi safishamsi closed this Jul 4, 2026
safishamsi added a commit that referenced this pull request Jul 4, 2026
19 fixes/features since 0.9.5. Highlights:
- Ruby: module/Struct.new/Class.new/Data.define container nodes (#1640) and
  constant-receiver singleton-call resolution (#1634) — Rails/Zeitwerk graphs
  now get real cross-file edges.
- Kill cross-language phantom imports_from edges from unresolved bare npm
  imports (#1638); harden semantic extraction against malformed LLM chunks
  (#1631); deterministic graph.json node/edge ordering for parallel semantic
  backends (#1632).
- Contributor extractor fixes: Apex interface multiple inheritance (#1645),
  Kotlin `by` delegation (#1644).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants