FIR: instantiate type argument to captured type if needed
This commit is contained in:
committed by
TeamCityServer
parent
bcf6582af7
commit
cd99c35649
+7
-2
@@ -53,14 +53,14 @@ open class TypeApproximatorConfiguration {
|
||||
override val intersectionTypesInContravariantPositions: Boolean get() = true
|
||||
}
|
||||
|
||||
abstract class AbstractCapturedTypesApproximation(val approximatedCapturedStatus: CaptureStatus) :
|
||||
sealed class AbstractCapturedTypesApproximation(val approximatedCapturedStatus: CaptureStatus?) :
|
||||
AllFlexibleSameValue() {
|
||||
override val allFlexible: Boolean get() = true
|
||||
override val errorType: Boolean get() = true
|
||||
|
||||
// i.e. will be approximated only approximatedCapturedStatus captured types
|
||||
override fun capturedType(ctx: TypeSystemInferenceExtensionContext, type: CapturedTypeMarker): Boolean =
|
||||
type.captureStatus(ctx) == approximatedCapturedStatus
|
||||
approximatedCapturedStatus != null && type.captureStatus(ctx) == approximatedCapturedStatus
|
||||
|
||||
override val intersection: IntersectionStrategy get() = IntersectionStrategy.ALLOWED
|
||||
override val typeVariable: (TypeVariableTypeConstructorMarker) -> Boolean get() = { true }
|
||||
@@ -79,6 +79,11 @@ open class TypeApproximatorConfiguration {
|
||||
override val intersectionTypesInContravariantPositions: Boolean get() = true
|
||||
}
|
||||
|
||||
object TypeArgumentApproximation : AbstractCapturedTypesApproximation(null) {
|
||||
override val integerLiteralType: Boolean get() = true
|
||||
override val intersectionTypesInContravariantPositions: Boolean get() = true
|
||||
}
|
||||
|
||||
object IntegerLiteralsTypesApproximation : AllFlexibleSameValue() {
|
||||
override val integerLiteralType: Boolean get() = true
|
||||
override val allFlexible: Boolean get() = true
|
||||
|
||||
Reference in New Issue
Block a user