Skip to content

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

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_989258318
Oct 5, 2026
Merged

copybara-service[bot] merged 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: 993930521
@copybara-service
copybara-service Bot merged commit 13dc629 into master Oct 5, 2026
2 checks passed
@copybara-service
copybara-service Bot deleted the test_989258318 branch October 5, 2026 22:14
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