Inference: handle Exact constraints with captured types properly

#KT-41818 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-04-15 15:55:41 +03:00
parent 51d348d5fa
commit 9b3f1b9b8a
9 changed files with 80 additions and 3 deletions
@@ -91,9 +91,6 @@ abstract class AbstractTypeCheckerContextForConstraintSystem(override val typeSy
val typeMarker = type.asSimpleType()?.asCapturedType() ?: return null
val projection = typeMarker.typeConstructorProjection()
if (projection.isStarProjection()) return null
return when (projection.getVariance()) {
TypeVariance.IN -> if (!out) typeMarker.lowerType() ?: projection.getType() else null
TypeVariance.OUT -> if (out) projection.getType() else null