feat(resolution): conformance-aware chained-method resolution (#750) (#754)

* feat(resolution): conformance-aware chained-method resolution (#750)

A chained static-factory/fluent call whose method lives on a SUPERTYPE the
receiver conforms to — a protocol-extension method (Swift), an interface default
method, or an inherited superclass method — now resolves. resolveMethodOnType
falls back to walking the return type's implements/extends edges (via the new
context.getSupertypes) when the method isn't a direct member. Because those edges
don't exist during the single-pass resolution, a second pass
(resolveChainedCallsViaConformance) re-resolves the deferred chained refs after
edges are built. Still validated, so a wrong inference yields no edge.

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

* docs(changelog): conformance-aware chained-method resolution (#750)

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-06-09 01:38:37 -04:00
committed by GitHub
co-authored by Claude Opus 4.8
parent aa07dc59d4
commit 48d4654e8d
7 changed files with 196 additions and 4 deletions
+11
View File
@@ -376,6 +376,12 @@ export class CodeGraph {
total,
});
});
// Second pass: chained calls whose method lives on a supertype the
// receiver conforms to (protocol-extension / inherited / default-
// interface). Needs the implements/extends edges the main pass just
// built, so it runs after resolution (#750).
this.resolver.resolveChainedCallsViaConformance();
}
// Refresh planner stats + checkpoint the WAL after bulk writes.
@@ -492,6 +498,11 @@ export class CodeGraph {
});
});
}
// Second pass: chained calls whose method lives on a supertype the
// receiver conforms to (protocol-extension / inherited). Needs the
// implements/extends edges built above (#750).
this.resolver.resolveChainedCallsViaConformance();
}
// Refresh planner stats + checkpoint the WAL after bulk writes.