Skip to content

Commit dbed512

Browse files
author
Oleksandr Karpovich
committed
CMP-7571: keep the calls to public $stable fields (in K1 klibs) as is
1 parent e7e183f commit dbed512

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/linkage/partial/PartiallyLinkedIrTreePatcher.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,10 @@ internal class PartiallyLinkedIrTreePatcher(
525525
val COMPOSE_STABILITY_GETTER_MARKER = $$"$stableprop_getter"
526526

527527
fun IrGetField.isComposeStableFieldAccess(): Boolean {
528-
if (!symbol.isBound) return false
528+
// If the field is public, it means it's in a K1-built klib, so we can proceed as before.
529+
// We have a problem only with IrGetField for private fields,
530+
// which are generated by K2 compose compiler plugin.
531+
if (!symbol.isBound || symbol.owner.visibility == DescriptorVisibilities.PUBLIC) return false
529532
return symbol.owner.name.asString().endsWith(COMPOSE_STABLE_FIELD_MARKER)
530533
}
531534

0 commit comments

Comments
 (0)