Skip to content

Look up Kotlin PropertyMetadata by property name instead of field signature. - #5301

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_989258318
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_989258318

Conversation

@copybara-service

Copy link
Copy Markdown

Look up Kotlin PropertyMetadata by property name instead of field signature.

Previously, KotlinMetadata matched fields to their Kotlin property metadata using the field's JVM descriptor, with a fallback that stripped the $delegate suffix from the field name when KAPT failed to resolve generated types in the descriptor (https://youtrack.jetbrains.com/issue/KT-35124).

Because a Kotlin class cannot have multiple properties with the same name and XFieldElement.getOwner() provides the owning XPropertyElement directly, we can look up properties by name instead. This simplifies the lookup, avoids descriptor mismatches on generated types, and prepares KotlinMetadata to take XPropertyElement directly in a follow-up change.

RELNOTES=N/A

…nature.

Previously, `KotlinMetadata` matched fields to their Kotlin property metadata using the field's JVM descriptor, with a fallback that stripped the `$delegate` suffix from the field name when KAPT failed to resolve generated types in the descriptor (https://youtrack.jetbrains.com/issue/KT-35124).

Because a Kotlin class cannot have multiple properties with the same name and `XFieldElement.getOwner()` provides the owning `XPropertyElement` directly, we can look up properties by name instead. This simplifies the lookup, avoids descriptor mismatches on generated types, and prepares `KotlinMetadata` to take `XPropertyElement` directly in a follow-up change.

RELNOTES=N/A
PiperOrigin-RevId: 989258318

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.

1 participant