Skip to content

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

Open

Description

@mixxer

Source build: package version 1.6.2, upstream a0c6c1b (current main 3f66df3 adds documentation only). Reproduced on macOS arm64 with Node 24.21.0.

extensions/Extensions.kt:

package extensions
import androidx.compose.ui.Modifier as DeclAlias
fun DeclAlias.pad() {}

caller/Calls.kt:

package caller
import androidx.compose.ui.Modifier as CallAlias
import extensions.pad
fun caller() { CallAlias.pad() }

After indexing these files, pad has a declaration but the call in caller has no edge to it. The receiver names are import aliases for the same type. The same problem occurs when both files use the same alias. The existing imported-receiver extension helper looks up the receiver by the type's exported name, while extraction keeps the receiver as written in the declaration.

Expected: link the imported extension using the receiver's imported type identity, keeping extensions on a different type and extensions outside the caller's scope out of the result. Different aliases in the two files should not change that identity.

This is a remaining corner case after #3023, not a request to restore the older #1948 implementation. A small change can reuse the existing import mappings and extension visibility check; no new tool or extraction format is needed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions