Skip to content

fix(kotlin): link extensions through imported receiver aliases - #3085

Draft
mixxer wants to merge 1 commit into
colbymchenry:mainfrom
mixxer:contrib/kotlin-extension-import-alias-20261030
Draft

mixxer wants to merge 1 commit into
colbymchenry:mainfrom
mixxer:contrib/kotlin-extension-import-alias-20261030

Conversation

@mixxer

@mixxer mixxer commented Oct 30, 2026

Copy link
Copy Markdown

Fixes #3084

A Kotlin extension whose receiver is written with an import alias now links from a caller using the same imported type, even when the two files use different aliases. The existing helper now considers methods by name, verifies the declaration's receiver import FQN, and retains its package/import visibility check. Extensions on another type and unimported extensions remain out of scope.

No extraction format, Rust walker, public tool or configuration changes. Adapted from the alias guard in downstream 649ec113, with additional independent-alias and negative cases. This is a focused follow-up to #3023, rather than reintroducing #1948.

Validation

  • macOS arm64, Node 24.21.0, fresh npm ci --ignore-scripts using the pinned lockfile; npm run build passed.
  • Full portable suite: 810 files passed, 18 skipped; 9,235 tests passed, 422 skipped, zero failures (npm test -- --minWorkers=1 --maxWorkers=4, CODEGRAPH_KERNEL=0).
  • Five new regression cases: same-file alias, four declaration/call alias combinations, wrong-type decoys and an unimported extension. Four fail on the unmodified upstream control; the fifth preserves existing behavior.
  • Rebuilt upstream native kernel: all five new tests pass on the native path too.
  • Code-only A/B on the SystemUI source subtree from AOSP frameworks/base 94b4c163b7dfe5ce3607f7bb8456f9573f7de57d: 5,166 indexed files, 159,871 nodes and 265,232 edges; canonical edge dumps are byte-identical with the same pinned dependencies.
  • Native/wasm extraction parity on that subtree: 5,059 files with zero differences, 107 existing parser deferrals; the Java/Kotlin torture fixtures also have zero differences.
  • git diff --check passed. Published source/test/changelog blob SHAs were checked against the locally validated files.

Based on upstream 3f66df358e97d10a4ed24577cf1f735b4441fbb0; its only changes after the source baseline a0c6c1b1 are the contribution guide, README and documentation index. No Node 22, Linux or Windows run is claimed. Draft for maintainer review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin: an extension on an imported receiver alias is missing from callers

1 participant