[FIR] Store expressions of receivers inside candidates instead of ReceiverValue

This is needed because of mutable nature of receiver values: implicit
  receiver values can be modified because of smartcasts, but in candidate
  we need to store snapshot of receiver in the form it was at the beginning
  of the resolution

^KT-58823 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-06-05 10:36:55 +03:00
committed by Space Team
parent b564260a33
commit 6409bf2fe8
26 changed files with 255 additions and 181 deletions
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.declarations.FirFile
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
import org.jetbrains.kotlin.fir.declarations.utils.isStatic
import org.jetbrains.kotlin.fir.declarations.utils.visibility
import org.jetbrains.kotlin.fir.expressions.FirExpression
import org.jetbrains.kotlin.fir.resolve.SupertypeSupplier
import org.jetbrains.kotlin.fir.resolve.calls.FirSimpleSyntheticPropertySymbol
import org.jetbrains.kotlin.fir.resolve.calls.ReceiverValue
@@ -30,7 +31,7 @@ object FirJavaVisibilityChecker : FirVisibilityChecker() {
symbol: FirBasedSymbol<*>,
useSiteFile: FirFile,
containingDeclarations: List<FirDeclaration>,
dispatchReceiver: ReceiverValue?,
dispatchReceiver: FirExpression?,
session: FirSession,
isCallToPropertySetter: Boolean,
supertypeSupplier: SupertypeSupplier