Fix compilation after rebase
This commit is contained in:
+4
-2
@@ -132,8 +132,10 @@ class KotlinToResolvedCallTransformer(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST") val resolvedCall =
|
||||
ktPrimitiveCompleter.completeResolvedCall(candidate, baseResolvedCall.completedDiagnostic) as ResolvedCall<D>
|
||||
val resolvedCall = ktPrimitiveCompleter.completeResolvedCall(
|
||||
candidate, baseResolvedCall.completedDiagnostic(resultSubstitutor)
|
||||
) as ResolvedCall<D>
|
||||
|
||||
forwardCallToInferenceSession(baseResolvedCall, context, resolvedCall, tracingStrategy)
|
||||
|
||||
resolvedCall
|
||||
|
||||
+11
-11
@@ -7,9 +7,11 @@ package org.jetbrains.kotlin.resolve.calls.model
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.components.*
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.buildResultingSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.components.CallableReferenceCandidate
|
||||
import org.jetbrains.kotlin.resolve.calls.components.TypeArgumentsToParametersMapper
|
||||
import org.jetbrains.kotlin.resolve.calls.components.extractInputOutputTypesFromCallableReferenceExpectedType
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.FreshVariableNewTypeSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintError
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableForLambdaReturnType
|
||||
@@ -184,16 +186,14 @@ sealed class CallResolutionResult(
|
||||
super.setAnalyzedResults(subResolvedAtoms)
|
||||
}
|
||||
|
||||
val completedDiagnostic: List<KotlinCallDiagnostic>
|
||||
get() {
|
||||
val substitutor = constraintSystem.buildResultingSubstitutor()
|
||||
return diagnostics.map {
|
||||
if (it !is NewConstraintError) return@map it
|
||||
val lowerType = it.lowerType.safeAs<KotlinType>()?.unwrap() ?: return@map it
|
||||
val newLowerType = substitutor.safeSubstitute(lowerType)
|
||||
NewConstraintError(newLowerType, it.upperType, it.position)
|
||||
}
|
||||
fun completedDiagnostic(substitutor: NewTypeSubstitutor): List<KotlinCallDiagnostic> {
|
||||
return diagnostics.map {
|
||||
if (it !is NewConstraintError) return@map it
|
||||
val lowerType = it.lowerType.safeAs<KotlinType>()?.unwrap() ?: return@map it
|
||||
val newLowerType = substitutor.safeSubstitute(lowerType)
|
||||
NewConstraintError(newLowerType, it.upperType, it.position)
|
||||
}
|
||||
}
|
||||
|
||||
override val atom: ResolutionAtom? get() = null
|
||||
|
||||
|
||||
@@ -90,12 +90,13 @@ open class TypeApproximatorConfiguration {
|
||||
object CapturedAndIntegerLiteralsTypesApproximation : TypeApproximatorConfiguration.AbstractCapturedTypesApproximation(FROM_EXPRESSION) {
|
||||
override val integerLiteralType: Boolean get() = true
|
||||
}
|
||||
|
||||
object IntegerLiteralsTypesApproximation : TypeApproximatorConfiguration.AllFlexibleSameValue() {
|
||||
override val integerLiteralType: Boolean get() = true
|
||||
override val allFlexible: Boolean get() = true
|
||||
override val intersection get() = ALLOWED
|
||||
override val typeVariable: (TypeVariableTypeConstructor) -> Boolean get() = { true }
|
||||
override val capturedType: (NewCapturedType) -> Boolean get() = { true }
|
||||
override val typeVariable: (TypeVariableTypeConstructorMarker) -> Boolean get() = { true }
|
||||
override fun capturedType(ctx: TypeSystemInferenceExtensionContext, type: CapturedTypeMarker): Boolean = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user