JVM_IR: simplify resolveFakeOverride call in SyntheticAccessorLowering
This commit is contained in:
+2
-11
@@ -738,7 +738,8 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle
|
|||||||
is IrField -> {
|
is IrField -> {
|
||||||
val correspondingProperty = declarationRaw.correspondingPropertySymbol?.owner
|
val correspondingProperty = declarationRaw.correspondingPropertySymbol?.owner
|
||||||
if (correspondingProperty != null && correspondingProperty.isFakeOverride) {
|
if (correspondingProperty != null && correspondingProperty.isFakeOverride) {
|
||||||
val realProperty = correspondingProperty.resolveFakeOverrideForProperty()
|
val realProperty = correspondingProperty.resolveFakeOverride()
|
||||||
|
?: throw AssertionError("No real override for ${correspondingProperty.render()}")
|
||||||
realProperty.backingField
|
realProperty.backingField
|
||||||
?: throw AssertionError(
|
?: throw AssertionError(
|
||||||
"Fake override property ${correspondingProperty.render()} with backing field " +
|
"Fake override property ${correspondingProperty.render()} with backing field " +
|
||||||
@@ -771,16 +772,6 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun IrProperty.resolveFakeOverrideForProperty(): IrProperty {
|
|
||||||
if (!isFakeOverride) return this
|
|
||||||
|
|
||||||
return this.overriddenSymbols
|
|
||||||
.map { it.owner }
|
|
||||||
.collectAndFilterRealOverrides()
|
|
||||||
.firstOrNull()
|
|
||||||
?: throw AssertionError("No real override for ${this.render()}")
|
|
||||||
}
|
|
||||||
|
|
||||||
private class OuterClassInfo(val outerClass: IrClass, val throughCrossinlineLambda: Boolean)
|
private class OuterClassInfo(val outerClass: IrClass, val throughCrossinlineLambda: Boolean)
|
||||||
|
|
||||||
private fun getOuterClassInfo(): OuterClassInfo? {
|
private fun getOuterClassInfo(): OuterClassInfo? {
|
||||||
|
|||||||
Reference in New Issue
Block a user