[NI] Take into account captured types for type depth computation
It's needed to estimate the count of steps for type approximation algorithm. After the estimated count of steps, we consider such type recursive and this algorithm returns some default value #KT-28598 Fixed
This commit is contained in:
@@ -470,6 +470,9 @@ internal fun UnwrappedType.typeDepth() =
|
||||
|
||||
internal fun SimpleType.typeDepth(): Int {
|
||||
if (this is TypeUtils.SpecialType) return 0
|
||||
if (this is NewCapturedType) {
|
||||
return constructor.projection.type.unwrap().typeDepth()
|
||||
}
|
||||
|
||||
val maxInArguments = arguments.asSequence().map {
|
||||
if (it.isStarProjection) 1 else it.type.unwrap().typeDepth()
|
||||
|
||||
Reference in New Issue
Block a user