[NI] Use effective variance for equal approximated type
It's totally safe from the point of type system and reduces extra `out` projections that can add problems with subtyping
This commit is contained in:
@@ -406,7 +406,12 @@ class TypeApproximator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newArguments[index] = TypeProjectionImpl(Variance.OUT_VARIANCE, approximatedSuperType)
|
if (NewKotlinTypeChecker.equalTypes(argumentType, approximatedSuperType)) {
|
||||||
|
newArguments[index] = approximatedSuperType.asTypeProjection()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newArguments[index] = TypeProjectionImpl(Variance.OUT_VARIANCE, approximatedSuperType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user