FIR inference: use generic version of error type in type approximator
This commit is contained in:
+3
-1
@@ -103,7 +103,9 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.typeDepth(): Int {
|
||||
require(this is ConeKotlinType)
|
||||
require(this is ConeKotlinType) {
|
||||
"Incorrect type of class ${this::class.java}: $this"
|
||||
}
|
||||
return when (this) {
|
||||
is ConeFlexibleType -> Math.max(lowerBound.typeDepthSimple(), upperBound.typeDepthSimple())
|
||||
else -> typeDepthSimple()
|
||||
|
||||
@@ -45,7 +45,11 @@ open class ConeTypeVariable(name: String) : TypeVariableMarker {
|
||||
}
|
||||
|
||||
class InferenceComponents(val ctx: TypeSystemInferenceExtensionContextDelegate) {
|
||||
private val approximator = object : AbstractTypeApproximator(ctx) {}
|
||||
private val approximator = object : AbstractTypeApproximator(ctx) {
|
||||
override fun createErrorType(message: String): SimpleTypeMarker {
|
||||
return ConeClassErrorType(message)
|
||||
}
|
||||
}
|
||||
val trivialConstraintTypeInferenceOracle = TrivialConstraintTypeInferenceOracle(ctx)
|
||||
private val incorporator = ConstraintIncorporator(approximator, trivialConstraintTypeInferenceOracle)
|
||||
private val injector = ConstraintInjector(incorporator, approximator)
|
||||
|
||||
Reference in New Issue
Block a user