[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:
@@ -0,0 +1,36 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
|
||||
class Inv<T>(val x: T)
|
||||
|
||||
fun case_1(a: Inv<out Inv<Inv<Inv<Inv<Inv<Int?>?>?>?>?>?>?) {
|
||||
if (a != null) {
|
||||
val b: Inv<out Inv<out Inv<out Inv<out Inv<Int?>?>?>?>?>? = a.x
|
||||
}
|
||||
}
|
||||
|
||||
fun case_2(a: Inv<out Inv<Inv<Inv<Inv<Inv<Int?>?>?>?>?>?>?) {
|
||||
if (a != null) {
|
||||
val b: Inv<out Inv<out Inv<out Inv<out Inv<Int?>?>?>?>?>? = a.x
|
||||
if (b != null) {
|
||||
val c = b.x
|
||||
if (c != null) {
|
||||
val d = c.x
|
||||
if (d != null) {
|
||||
val e = d.x
|
||||
if (e != null) {
|
||||
val f = e.x
|
||||
if (f != null) {
|
||||
val g = <!DEBUG_INFO_SMARTCAST!>f<!>.x
|
||||
if (g != null) {
|
||||
takeInt(<!DEBUG_INFO_SMARTCAST!>g<!>)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun takeInt(i: Int) {}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun case_1(/*0*/ a: Inv<out Inv<Inv<Inv<Inv<Inv<kotlin.Int?>?>?>?>?>?>?): kotlin.Unit
|
||||
public fun case_2(/*0*/ a: Inv<out Inv<Inv<Inv<Inv<Inv<kotlin.Int?>?>?>?>?>?>?): kotlin.Unit
|
||||
public fun takeInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
|
||||
public final class Inv</*0*/ T> {
|
||||
public constructor Inv</*0*/ T>(/*0*/ x: T)
|
||||
public final val x: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user