JVM_IR: move MoveOrCopyCompanionObjectFields down a bit

More specifically, it should be done *just before*
JvmPropertiesLowering, as walking the IR tree between them will result
in visiting the moved backing fields twice (once via the companion's
parent, once via the IrProperty).

Ideally, this group of 3 lowerings should be merged into 1 as they are
completely inseparable, but this is slightly harder to do properly.

 #KT-42527 Fixed
This commit is contained in:
pyos
2020-10-07 18:56:55 +02:00
committed by Alexander Udalov
parent dd1682510f
commit af98720720
@@ -288,12 +288,14 @@ private val jvmFilePhases = listOf(
lateinitDeclarationLoweringPhase,
lateinitUsageLoweringPhase,
moveOrCopyCompanionObjectFieldsPhase,
inlineCallableReferenceToLambdaPhase,
functionReferencePhase,
suspendLambdaPhase,
propertyReferencePhase,
constPhase,
// TODO: merge the next three phases together, as visitors behave incorrectly between them
// (backing fields moved out of companion objects are reachable by two paths):
moveOrCopyCompanionObjectFieldsPhase,
propertiesPhase,
remapObjectFieldAccesses,
anonymousObjectSuperConstructorPhase,