[FIR] Introduce & use FirTypeRef.coneType

This commit is contained in:
Mikhail Glukhikh
2020-06-30 11:23:50 +03:00
parent 0392fe75fc
commit d846a22e33
55 changed files with 162 additions and 193 deletions
@@ -9,8 +9,7 @@ import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.resolve.calls.AbstractConeCallConflictResolver
import org.jetbrains.kotlin.fir.resolve.calls.Candidate
import org.jetbrains.kotlin.fir.resolve.inference.InferenceComponents
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.coneTypeUnsafe
import org.jetbrains.kotlin.fir.types.coneType
import org.jetbrains.kotlin.resolve.calls.results.FlatSignature
import org.jetbrains.kotlin.resolve.calls.results.TypeSpecificityComparator
@@ -55,7 +54,7 @@ class ConeEquivalentCallConflictResolver(
): Boolean {
if (first.symbol.callableId != second.symbol.callableId) return false
if (first.isExpect != second.isExpect) return false
if (first.receiverTypeRef?.coneTypeUnsafe<ConeKotlinType>() != second.receiverTypeRef?.coneTypeUnsafe()) {
if (first.receiverTypeRef?.coneType != second.receiverTypeRef?.coneType) {
return false
}
val firstSignature = createFlatSignature(firstCandidate, first)
@@ -108,7 +108,7 @@ private fun StringBuilder.appendConeType(coneType: ConeKotlinType) {
}
is ConeTypeParameterType -> {
val representative = coneType.lookupTag.typeParameterSymbol.fir.bounds.firstOrNull {
(it as? FirResolvedTypeRef)?.type is ConeClassLikeType
it.coneType is ConeClassLikeType
}
if (representative == null || representative is FirImplicitNullableAnyTypeRef || representative is FirImplicitAnyTypeRef) {
append("Ljava/lang/Object")