Noticed while implementing #1005 Phase 2 Item 1 (call-graph same-package tier). jvm-same-package-signals.ts's collectTopLevelDeclarations restricts to top-level class/interface declarations via !chunk.metadata.parentClass — same-package visibility only applies to top-level types, per JLS/Kotlin semantics.
The Kotlin AST extractor, however, doesn't currently set parentClass on a nested class's own chunk the way the Java extractor does. This means a Kotlin nested class (e.g. inside a sealed hierarchy or a companion-adjacent inner class) is currently indistinguishable from a real top-level declaration in jvm-same-package-signals.ts's index — it gets treated as eligible for G1'/G5 resolution when it structurally shouldn't be.
This is a real but small, out-of-scope-for-#1005-Phase-2 precision issue (not something the same-package tier's own logic can fix — it's upstream, in the Kotlin extractor itself). Filing to track it separately. Likely fix: audit KotlinSymbolExtractor (or wherever nested-class chunks are built) for parity with the Java extractor's parentClass assignment, then add a regression test to jvm-same-package-signals.test.ts asserting a Kotlin nested class is excluded from collectTopLevelDeclarations.
Noticed while implementing #1005 Phase 2 Item 1 (call-graph same-package tier).
jvm-same-package-signals.ts'scollectTopLevelDeclarationsrestricts to top-level class/interface declarations via!chunk.metadata.parentClass— same-package visibility only applies to top-level types, per JLS/Kotlin semantics.The Kotlin AST extractor, however, doesn't currently set
parentClasson a nested class's own chunk the way the Java extractor does. This means a Kotlin nested class (e.g. inside a sealed hierarchy or a companion-adjacent inner class) is currently indistinguishable from a real top-level declaration injvm-same-package-signals.ts's index — it gets treated as eligible for G1'/G5 resolution when it structurally shouldn't be.This is a real but small, out-of-scope-for-#1005-Phase-2 precision issue (not something the same-package tier's own logic can fix — it's upstream, in the Kotlin extractor itself). Filing to track it separately. Likely fix: audit
KotlinSymbolExtractor(or wherever nested-class chunks are built) for parity with the Java extractor'sparentClassassignment, then add a regression test tojvm-same-package-signals.test.tsasserting a Kotlin nested class is excluded fromcollectTopLevelDeclarations.