FIR: Fix candidate receivers orders when choosing a context receiver

^KT-53257 Fixed
This commit is contained in:
Denis.Zharkov
2022-07-22 13:31:08 +02:00
committed by Space
parent 8299cec66b
commit 7f7e5c5975
8 changed files with 57 additions and 18 deletions
@@ -200,7 +200,7 @@ object CheckContextReceivers : ResolutionStage() {
}?.takeUnless { it.isEmpty() } ?: return
val receiverGroups: List<List<ImplicitReceiverValue<*>>> =
context.bodyResolveContext.towerDataContext.towerDataElements.mapNotNull { towerDataElement ->
context.bodyResolveContext.towerDataContext.towerDataElements.asReversed().mapNotNull { towerDataElement ->
towerDataElement.implicitReceiver?.let(::listOf) ?: towerDataElement.contextReceiverGroup
}