You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: C#: interface dispatch stops at the interface when there is more than one implementer, and property access through an interface is not linked #3800
Related to #3003. Once a call has reached an interface member, a walk only continues to the
implementation when the interface has exactly one implementer. With two or more, the graph
stops at the interface, which is where most interfaces in practice sit. Reading a property through
an interface-typed receiver produces no edge at all.
No dispatches_to from IConnecter.Read() to either implementation, and nothing for c.Count.
Proposed solution
dispatches_to from an interface member to the same-named member of every implementing
type (and subclasses of one), explicit implementations included, with confidence: INFERRED
and perhaps a score that falls with the implementer count. C#: a call through an interface dead-ends at the interface method, so injected dependencies cut every chain #3003's reasoning ("guessing among
several implementers would not" mirror the runtime) is right for a single call site, but for a
static structural graph the question is "what can this call reach", and the answer is all of
them. Stopping at the interface answers "nothing".
A calls edge (or a distinct relation such as accesses) from a method to an interface
property it reads or writes through an interface-typed receiver. Property getters are method
calls, and in interface-heavy code they are a large share of the traffic across the seam.
Limiting this to interface receivers would keep it from flooding the graph with every obj.Name read.
Alternatives considered
No response
Area
Graph building or querying
Additional context
in a Unity codebase whose editor assembly may only reach the runtime through interfaces,
the busiest seam interface has three implementers and much of the editor's traffic through it is
property reads (Ed.DataOwner, Ed.EditorLayouts). A local post-pass doing exactly (1) and (2)
added about 170 member-level dispatch edges and 190 property-access edges to a ~120-file graph,
and made editor-to-implementation paths two hops long.
Activity
feat(dispatch): link interface members to every implementer, not just…