K2, MPP: Fix parent lookup in mangler in MPP scenario
fixes compilation of the ListTest.kt in stdlib tests #KT-57131 fixed (bootstrap required to see the effect!)
This commit is contained in:
committed by
Space Team
parent
1d72681e4e
commit
feca40071d
+8
-2
@@ -141,13 +141,19 @@ class FirJvmMangleComputer(
|
||||
}
|
||||
|
||||
override fun getEffectiveParent(typeParameter: ConeTypeParameterLookupTag): FirMemberDeclaration = typeParameter.symbol.fir.run {
|
||||
|
||||
fun FirTypeParameter.sameAs(other: FirTypeParameter) =
|
||||
this === other ||
|
||||
(name == other.name && bounds.size == other.bounds.size &&
|
||||
bounds.zip(other.bounds).all { it.first.coneType == it.second.coneType })
|
||||
|
||||
for (parent in typeParameterContainers) {
|
||||
if (this in parent.typeParameters) {
|
||||
if (parent.typeParameters.any { this.sameAs(it.symbol.fir) }) {
|
||||
return parent
|
||||
}
|
||||
if (parent is FirCallableDeclaration) {
|
||||
val overriddenFir = parent.originalForSubstitutionOverride
|
||||
if (overriddenFir is FirTypeParametersOwner && this in overriddenFir.typeParameters) {
|
||||
if (overriddenFir is FirTypeParametersOwner && overriddenFir.typeParameters.any { this.sameAs(it) }) {
|
||||
return parent
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user