Repository navigation
Conversation
|
I ran this against Edge diff. 9 edges were removed and 2 added, and all 11 changes are correct:
The three Kotlin-only apps are unchanged. The build and full suite pass. On Regressions: four edges that
Suggested fix. When the imported type is in the index, fall through to the existing logic instead of returning null. Return null only when the type is external and no project extension is declared on that receiver name. Minor points:
It merges cleanly with #1933, and the two are complementary. #1933 types receivers from property and local declarations; it doesn't cover |
|
Addressed the four reported regressions in d30590c. Imported project types can continue through inherited-member resolution; visible project extensions remain eligible, including companion, object, cross-file, and external-type extensions. An extension not imported into the caller stays unresolved. The import check now accepts a trailing line comment, and The test fixture imports cross-package extensions explicitly because Kotlin's package/import rules make imports file-local; overload resolution considers accessible members and extensions in scope, with members taking priority. This is also consistent with the reference-target and scope model exposed by Kotlin's Analysis API. That is a design comparison, not a claim about Kotlin LSP's closed implementation. I kept the local import scan for now: |
|
Fork follow-up: mixxer/codegraph-aosp#8 carries the reviewer regression fixes on top of the fork's merged Kotlin PR. Its Node 22/24, native kernel/AOSP, and final CI checks all passed. |
|
Re-checked All four reported regressions are fixed:
Corpora: three Kotlin-only Android apps are unchanged. A Kotlin/Java/C app has 9 lost and 2 gained, all 11 correct, the same as the previous head. Tests: the Kotlin-related suites plus It also merges cleanly with #1933 and the rest of our open resolver work, with no behavioural conflicts. LGTM. The only conflict is textual, with #1949, in |
…by qualified name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for rechecking the native-kernel cases and the corpus diff. I agree with the result; I don't see another code change needed from this review. I'll resolve the textual conflict with #1949 on whichever PR lands second. |
|
Fork integration status: mixxer/codegraph-aosp#8 is merged at |
|
Re-checked against main (34ede4d). It still merges cleanly, and main now covers 9 of the 12 assertions in 🤖 Generated with Claude Code |
…n on it colbymchenry#2196 made a Kotlin import from outside the project own its name, so `Modifier.fillMaxSize()` after `import androidx.compose.ui.Modifier` no longer lands on a same-named project method. The rule returns before any other strategy, so a project extension on that type - Compose's `fun Modifier.pad()`, indexed as `Modifier::pad` - could not be reached by `Modifier.pad()` either (nor `Color.fromHex()` on a `fun Color.Companion.fromHex()`). Inside the rule, a Kotlin `Type.member` call now resolves to a project extension `Type::member` that the call site can see (same file or package, or imported by name or `.*`, as for other top-level Kotlin declarations) and whose own file imports the same type. Anything else stays unlinked, as before. The visibility check follows the idea of `kotlinExtensionInScope` from the discussion in colbymchenry#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d30590c to
a842527
Compare
…n on it colbymchenry#2196 made a Kotlin import from outside the project own its name, so `Modifier.fillMaxSize()` after `import androidx.compose.ui.Modifier` no longer lands on a same-named project method. The rule returns before any other strategy, so a project extension on that type - Compose's `fun Modifier.pad()`, indexed as `Modifier::pad` - could not be reached by `Modifier.pad()` either (nor `Color.fromHex()` on a `fun Color.Companion.fromHex()`). Inside the rule, a Kotlin `Type.member` call now resolves to a project extension `Type::member` that the call site can see (same file or package, or imported by name or `.*`, as for other top-level Kotlin declarations) and whose own file imports the same type. Anything else stays unlinked, as before. The visibility check follows the idea of `kotlinExtensionInScope` from the discussion in colbymchenry#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n on it colbymchenry#2196 made a Kotlin import from outside the project own its name, so `Modifier.fillMaxSize()` after `import androidx.compose.ui.Modifier` no longer lands on a same-named project method. The rule returns before any other strategy, so a project extension on that type - Compose's `fun Modifier.pad()`, indexed as `Modifier::pad` - could not be reached by `Modifier.pad()` either (nor `Color.fromHex()` on a `fun Color.Companion.fromHex()`). Inside the rule, a Kotlin `Type.member` call now resolves to a project extension `Type::member` that the call site can see (same file or package, or imported by name or `.*`, as for other top-level Kotlin declarations) and whose own file imports the same type. Anything else stays unlinked, as before. The visibility check follows the idea of `kotlinExtensionInScope` from the discussion in colbymchenry#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n on it colbymchenry#2196 made a Kotlin import from outside the project own its name, so `Modifier.fillMaxSize()` after `import androidx.compose.ui.Modifier` no longer lands on a same-named project method. The rule returns before any other strategy, so a project extension on that type - Compose's `fun Modifier.pad()`, indexed as `Modifier::pad` - could not be reached by `Modifier.pad()` either (nor `Color.fromHex()` on a `fun Color.Companion.fromHex()`). Inside the rule, a Kotlin `Type.member` call now resolves to a project extension `Type::member` that the call site can see (same file or package, or imported by name or `.*`, as for other top-level Kotlin declarations) and whose own file imports the same type. Anything else stays unlinked, as before. The visibility check follows the idea of `kotlinExtensionInScope` from the discussion in colbymchenry#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@colbymchenry @danusha2345 Thanks for the follow-up in #2258 and for carrying forward the visibility check. Both PRs now change the outside-import guard in matchReferenceInner, so it would help to agree on the split before rebasing. Could #2258 own that guard and its external-type identity/visibility tests, with #1948 retaining the imported Outer.Inner() constructor case, the unimported Modes.hidden() guard, and the companion/object/inherited-member regression coverage? In particular, #2258's different-Modifier-type negative case should be preserved alongside #1948's imported project-type cases. Which PR would you prefer to land first, and does that division work for you? This would preserve both sets of regression coverage without maintaining competing fixes for the same outside-import guard. |
|
@mixxer That division works for me.
I'd land #2258 first: it is the smaller change (one helper plus a one-line change at the guard), so #1948 then only has to drop its own hunk at that guard when rebasing — the rest of #1948 is in For what it's worth, I already run the two together in a local build in exactly that shape — #2258's form of the guard, #1948's #2258 currently conflicts with |
|
Thanks @danusha2345 for confirming the split and testing the two suites together. Agreed: #2258 owns the outside-import guard and external-type identity/visibility tests, including the different-Modifier negative case; #1948 keeps the Outer.Inner() constructor case, Modes.hidden() guard, and companion/object/inherited-member coverage. Landing #2258 first sounds reasonable. I'll wait for @colbymchenry's final order before rebasing. I've also noted the possible unreachable library-type branch in importedType; the imported project-type behavior and both sets of regression tests need to stay intact. |
a842527 to
f32a859
Compare
…n on it colbymchenry#2196 made a Kotlin import from outside the project own its name, so `Modifier.fillMaxSize()` after `import androidx.compose.ui.Modifier` no longer lands on a same-named project method. The rule returns before any other strategy, so a project extension on that type - Compose's `fun Modifier.pad()`, indexed as `Modifier::pad` - could not be reached by `Modifier.pad()` either (nor `Color.fromHex()` on a `fun Color.Companion.fromHex()`). Inside the rule, a Kotlin `Type.member` call now resolves to a project extension `Type::member` that the call site can see (same file or package, or imported by name or `.*`, as for other top-level Kotlin declarations) and whose own file imports the same type. Anything else stays unlinked, as before. The visibility check follows the idea of `kotlinExtensionInScope` from the discussion in colbymchenry#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f32a859 to
3a9e746
Compare
Summary
Resolve calls through imported Kotlin and Java types, including Outer.Inner constructors, while rejecting unimported extensions and preserving companion, object and inherited-member calls. #2258 remains the owner of the outside-import guard and external-type identity/visibility follow-up; its implementation and this PR pass together in a separate integration check. Because #2258 is unmerged, this PR retains its existing library-extension behavior until that change lands.
Validation
1ce1167e6f647f584220926befd86fd1881d3f70; validated head3a9e74619f6955bebef38d0abe6faaaf90db6873.f25994626fefad6e6b31ff27c56ae0fc2f4f888d; fix(kotlin): a call on an outside type reaches the project's extension on it #2258 remains unmerged and unchanged by this work.