Skip to content

Indirect references through interface/abstract base classes lack polymorphic resolution #2060

Description

@Widthdom

Summary

When a symbol calls an interface method or abstract base class method, the reference graph records the static call target but does not resolve which concrete implementations may actually handle the call at runtime. This breaks transitive impact analysis for polymorphic dispatch scenarios, leaving downstream callers of concrete implementations unreachable.

Where

  • src/CodeIndex/Database/DbReader.GraphQueries.cs:697-779 (GetCallersExact)
  • src/CodeIndex/Database/DbReader.CSharpResolution.cs:135-142 (CollectInheritedCSharpContainingTypes only walks base chain, not interfaces)

Suggested approach

  1. Track interface implementations and abstract method overrides as implicit edges in the symbol_references table alongside explicit call edges
  2. When resolving callers in GetCallersExact, include calls to abstract/interface base methods and map them to all concrete implementing types
  3. Add a new reference_kind='polymorphic_impl' to distinguish resolved virtual dispatch from direct call edges

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions