K2: Fix compilation after making Candidate::symbol a var

See the previous commits

Explicit cast became necessary as the smart cast stopped working there
This commit is contained in:
Denis.Zharkov
2023-08-07 18:14:08 +02:00
committed by Space Team
parent 034671ad78
commit 3aa635a766
2 changed files with 3 additions and 2 deletions
@@ -48,7 +48,7 @@ internal object CheckCallableReferenceExpectedType : CheckerStage() {
else -> null
}
val fir: FirCallableDeclaration = candidate.symbol.fir
val fir: FirCallableDeclaration = candidate.symbol.fir as FirCallableDeclaration
val (rawResultingType, callableReferenceAdaptation) = buildReflectionType(fir, resultingReceiverType, candidate, context)
val resultingType = candidate.substitutor.substituteOrSelf(rawResultingType)
@@ -117,9 +117,10 @@ class ConeOverloadConflictResolver(
}
private fun Candidate.overrides(other: Candidate): Boolean {
val symbol = symbol
if (symbol !is FirCallableSymbol || other.symbol !is FirCallableSymbol) return false
val otherOriginal = other.symbol.unwrapSubstitutionOverrides()
val otherOriginal = (other.symbol as FirCallableSymbol).unwrapSubstitutionOverrides()
if (symbol.unwrapSubstitutionOverrides<FirCallableSymbol<*>>() == otherOriginal) return true
val scope = originScope as? FirTypeScope ?: return false