Repository navigation
Description
First of all, thank you for the very quick response on #4874! We upgraded to 0.9.100 the day it came out, and it solved a lot for us. In our private mixed Android project, graphify affected on a widely used Java class went from 0 of 36 Kotlin importers to 36 of 36, and imports and inheritance now resolve in both directions.
While validating the upgrade, we noticed a few remaining inconsistencies in calls edges from Kotlin. They are narrower than the original report, so we are opening a new issue rather than reopening #4874.
What we expected
Each call below should produce a calls edge to the method that is actually called, or no edge when the target is outside the repository:
- A Kotlin call to an overloaded Java method links to that method, as the equivalent Java call does.
- A Kotlin call inside an
initblock links to the called method. - A call to a method inherited from an external class does not link to an unrelated class that happens to have a method with the same name.
What actually happened
- Overloaded Java method called from Kotlin: no edge is created. The non-overloaded method in the same class resolves from the same Kotlin file, and Java callers resolve in both cases.
- Call inside a Kotlin
initblock: no edge is created. The class has no node for theinitblock, so the call has no source to attach to. This may be related to Kotlin: calls in a class property initializer are never collected — only function bodies are walked (DI-container shape invisible) #2565, which covered property initializers. - Inherited external method:
KotlinScreen.title()callsgetStringinherited fromandroid.app.Activity, but gets anINFERREDcallsedge to the unrelatedPrefs.getString(). This one may have a different cause from the other two, so please feel free to split it out.
graphify affected depends on these edges, so case 1 and case 2 silently omit callers, and case 3 lists callers that are not real.
Steps to reproduce
Tested on a clean folder with 0.9.100:
# src/com/example/util/Logger.java
package com.example.util;
public class Logger {
public static int single(String tag) { return 0; }
public static int overloaded(String tag) { return 0; }
public static int overloaded(String tag, String msg) { return 0; }
}
# src/com/example/util/Prefs.java
package com.example.util;
public class Prefs {
public String getString(String key) { return key; }
}
# src/com/example/app/JavaCaller.java
package com.example.app;
import com.example.util.Logger;
public class JavaCaller {
public void callSingle() { Logger.single("a"); }
public void callOverloaded() { Logger.overloaded("a"); }
}
# src/com/example/app/KotlinCaller.kt
package com.example.app
import com.example.util.Logger
class KotlinCaller {
fun callSingle() { Logger.single("a") }
fun callOverloaded() { Logger.overloaded("a") }
}
# src/com/example/app/KotlinInit.kt
package com.example.app
import com.example.util.Logger
class KotlinInit {
init { Logger.single("a") }
}
# src/com/example/app/KotlinScreen.kt
package com.example.app
import android.app.Activity
class KotlinScreen : Activity() {
fun title(): String = getString(1)
}
graphify update .
# then list the edges with relation "calls" in graphify-out/graph.jsonGraph output
All calls edges in graph.json:
JavaCaller.java .callOverloaded() -> Logger.java .overloaded() [EXTRACTED]
JavaCaller.java .callSingle() -> Logger.java .single() [EXTRACTED]
KotlinCaller.kt .callSingle() -> Logger.java .single() [EXTRACTED]
KotlinScreen.kt .title() -> Prefs.java .getString() [INFERRED] (unrelated class)
Missing:
KotlinCaller.kt .callOverloaded() -> Logger.java .overloaded()
KotlinInit.kt (init block) -> Logger.java .single()
Impact on a real project
In our project, 38 Kotlin files call a Java logging class whose main methods are overloaded, and the graph links only 1 of them. The one that links is a call to a non-overloaded method. We also see 121 INFERRED Kotlin calls to one Java class's getString(), which look like case 3, although we have not checked each one.
For now, we keep confirming callers with git grep, which works fine as a workaround.
Environment
- Graphify version: 0.9.100
- Operating system: Windows
- Python: 3.14
- Installation method: uv tool install
- No provider API keys set
Thanks again for the great work and for how quickly you handled the previous report!
Activity
github-actions commentedon Nov 1, 2026
Thanks for opening this issue, @rafaelltlins. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
test(kotlin): pin the Kotlin/Java call edges that already resolve (Gr…
fix(kotlin): resolve a Kotlin call to an overloaded method (Graphify-…
fix(kotlin): attribute calls inside an init block to the class (Graph…
fix(resolve): don't bind a bare call to a class its caller can't reach (
test(kotlin): pin the Kotlin/Java call edges that already resolve (#4935
fix(kotlin): resolve a Kotlin call to an overloaded method (#4935)
fix(kotlin): attribute calls inside an init block to the class (#4935)
fix(resolve): don't bind a bare call to a class its caller can't reach (
chore: combined AST cache schema 37 for the solidity/python/kotlin/go…
safishamsi commentedon Nov 3, 2026
Fixed in 0.9.102 (published to PyPI) via #4956. Kotlin overloaded calls and init-block calls resolve, and a bare call no longer binds to a class the caller cannot reach.