[NI] Introduce type depth in CS calculator to avoid SOE

This commit is contained in:
Mikhail Zarechenskiy
2017-07-06 14:49:35 +03:00
parent cf75afba66
commit e7cd615450
6 changed files with 67 additions and 12 deletions
@@ -0,0 +1,18 @@
class A : FirstOwner<Holder<A>>
class B : SecondOwner<Holder<B>>
interface FirstOwner<T : StubElement<*>> : SecondOwner<T>
interface SecondOwner<T : StubElement<*>>
interface StubElement<T>
interface Holder<T> : StubElement<T>
fun test(a: A?, b: B) {
val c = a ?: b
}
fun box(): String {
test(A(), B())
return "OK"
}