Repository navigation
Description
Summary
A fully-qualified call — com.demo.a.BetaScreen(2) — produces no calls edge,
while the same call written against an import does. The resolver appears to
consider only the file's import list, so any call written in qualified form is
invisible to the graph.
Measured on a 541-file Kotlin codebase (Android app + Wear module): the
navigation entry point called 43 of its 65 screens in qualified form, so
explain/affected on that node reported 34% of the real fan-out. Rewriting
those 43 call sites as imports — no behaviour change, no code deleted — took
recall to 83% (the remaining 17% is a separate parse bug, filed separately).
105 qualified call sites across 54 files remain unresolved elsewhere in the repo.
This is not a Compose or lambda problem: it reproduces with plain top-level
functions and with an object member, and it is not about packages either —
the qualified form fails even when caller and callee share a package.
Reproduction
graphify 0.9.36, graphify extract src --code-only (no LLM, no API key).
// src/a/Lib.kt
package com.demo.a
fun AlphaScreen(x: Int) { println(x) }
fun BetaScreen(x: Int) { println(x) }
fun GammaScreen(x: Int) { println(x) }
fun DeltaScreen(x: Int) { println(x) }
object Helper { fun help(x: Int) { println(x) } }// src/b/Nav.kt
package com.demo.b
import com.demo.a.AlphaScreen
import com.demo.a.GammaScreen
fun composable(route: String, body: () -> Unit) { body() }
fun NavGraph() {
composable("alpha") { AlphaScreen(1) } // plain import
composable("beta") { com.demo.a.BetaScreen(2) } // qualified
composable("gamma") { GammaScreen(3) } // plain import
composable("delta") { com.demo.a.DeltaScreen(4) } // qualified
com.demo.a.Helper.help(5) // qualified, object member
}// src/b/Same.kt — caller in the SAME package as the callee
package com.demo.a
fun SamePackageCaller() {
BetaScreen(9) // same package, no import needed
com.demo.a.DeltaScreen(10) // qualified, same package
}Observed
All calls edges in the resulting graph:
b_nav_navgraph -> b_nav_composable
b_nav_navgraph -> a_lib_gammascreen # import
b_nav_navgraph -> a_lib_alphascreen # import
b_same_samepackagecaller -> a_lib_betascreen # same package, unqualified
Expected
Three more edges:
b_nav_navgraph -> a_lib_betascreen # com.demo.a.BetaScreen(2)
b_nav_navgraph -> a_lib_deltascreen # com.demo.a.DeltaScreen(4)
b_same_samepackagecaller -> a_lib_deltascreen # com.demo.a.DeltaScreen(10)
The Helper.help(5) call produces no edge either.
The last pair is the useful control: BetaScreen(9) resolves and
com.demo.a.DeltaScreen(10) does not, from the same file, in the same package,
to functions declared side by side. The discriminator is purely the qualified
form of the call expression, not the location of the callee.
Suggested fix
When the callee is a navigation_expression / qualified path whose prefix is a
package name, resolve on the last identifier segment — the same key already used
for imported and same-package calls. That is strictly additive: today those call
sites yield no edge at all, so there is no edge to regress.
If a stricter behaviour is preferred, the prefix could be matched against the
callee's declared package before emitting, which would also avoid the
name-collision concern raised in #2460.
Why this is not one of the existing Kotlin issues
I checked the open Kotlin set before filing:
- Kotlin: _KOTLIN_CONFIG declares node type
import_header, bundled grammar emitsimport— every Kotlin imports edge is silently dropped (45% -> 95% dep recall with a 2-line fix) #2526 (open) —import_headervsimportnode type, dropping imports
edges. Different symptom, and on my corpus import-based call resolution
works (theAlphaScreenedge above exists), so whatever that fixes, it does
not cover the qualified form. - Kotlin: member calls on typed receivers (property / getter return / local val) never resolve to method-level calls edges — Kotlin port of the Swift #1604 fix #1699 (open) — member calls on typed receivers (property / getter /
local val). Here the receiver is a package path, not a value, and the plain
top-level function case has no receiver at all. - Kotlin: cross-file calls to
object(singleton) members produce no calls edges — same-file resolution works #1698 (open) — cross-file calls toobjectmembers. MyHelper.help(5)
case may share its root cause, but the top-level function cases in this report
involve noobject, and the same-package control isolates the qualified form
on its own. - Name-only identifier resolution creates false cross-module reference edges and inflated betweenness #2460 (open) — name-only resolution creating false edges. This report is
the opposite disposition: edges that should exist and do not.
Environment
graphify 0.9.36 · tree-sitter 0.25.2 · tree-sitter-kotlin 1.1.0 · Python 3.11 ·
Linux · extract --code-only (AST only).
Activity
fix(extract): TS member-call gating + Kotlin grammar match (#2553, #2552
safishamsi commentedon Aug 8, 2026
Fixed in v0.9.37. A fully-qualified call such as
com.example.Foo.bar()now flattens the navigation chain and produces acallsedge (resolved against the callee package/type). Thanks.Merge upstream/v8 (v0.9.37) into chore/sync-upstream-0937
fix: JS/Kotlin/Swift/SQL extractor correctness batch; bump to 0.9.38 (#…
fix(extract): TS member-call gating + Kotlin grammar match (Graphify-…
fix: JS/Kotlin/Swift/SQL extractor correctness batch; bump to 0.9.38 (G…
fix(csharp): resolve qualified constructions against declared namespaces
feat(kernel): Kotlin native walker — all ten languages now gated
Resolve Kotlin member calls through the receiver's declared type
Resolve Kotlin member calls through the receiver's declared type
Resolve Kotlin member calls through the receiver's declared type
Resolve Kotlin member calls through the receiver's declared type