[FIR] Fix scope of Java classes that inherit multiple properties with the same name

Use the receiver and context receiver types in addition to the property
name as cache keys for the synthetic property generation.
Also, fix logic that searches for accessor overrides by comparing
receiver and context receiver types.
Finally, let synthetic properties delegate their receiverParameter and
contextReceivers to their accessors.

#KT-65464 Fixed
#KT-66195
This commit is contained in:
Kirill Rakhman
2024-02-28 12:11:09 +01:00
committed by Space Team
parent 89ecb92551
commit 0889770ccd
6 changed files with 53 additions and 13 deletions
@@ -62,7 +62,7 @@ class FirSyntheticProperty @FirImplementationDetail internal constructor(
get() = false
override val receiverParameter: FirReceiverParameter?
get() = null
get() = getter.receiverParameter
override val isVal: Boolean
get() = !isVar
@@ -84,7 +84,7 @@ class FirSyntheticProperty @FirImplementationDetail internal constructor(
get() = FirPropertyBodyResolveState.ALL_BODIES_RESOLVED
override val contextReceivers: List<FirContextReceiver>
get() = emptyList()
get() = getter.contextReceivers
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
returnTypeRef.accept(visitor, data)
@@ -47,7 +47,7 @@ class FirSyntheticPropertyAccessor @FirImplementationDetail internal constructor
get() = delegate.dispatchReceiverType
override val receiverParameter: FirReceiverParameter?
get() = null
get() = delegate.receiverParameter
override val deprecationsProvider: DeprecationsProvider
get() = delegate.deprecationsProvider
@@ -75,7 +75,7 @@ class FirSyntheticPropertyAccessor @FirImplementationDetail internal constructor
}
override val contextReceivers: List<FirContextReceiver>
get() = emptyList()
get() = delegate.contextReceivers
override val controlFlowGraphReference: FirControlFlowGraphReference? = null