Files
kotlin-fork/idea/testData/checker/CyclicHierarchy.kt
T
Andrey Breslav 8be40c29cf CYCLIC_INHERITANCE_HIERARCHY reworked
We do not try to recover too gracefully from a cyclic hierarchy any more:
we simply remove all the edges that belong to a cycle instead of intelligently finding one most convenient edge to cut.
This is done in both lazy and eager resolve to keep tests passing.
2014-03-17 21:55:15 +04:00

30 lines
584 B
Kotlin

trait A {
fun foo() {}
}
trait B : A, <error>E</error> {}
trait C : <error>B</error> {}
trait D : <error>B</error> {}
trait E : <error>F</error> {}
trait F : <error>D</error>, <error>C</error> {}
trait G : F {}
trait H : F {}
val a : A? = null
val b : B? = null
val c : C? = null
val d : D? = null
val e : E? = null
val f : F? = null
val g : G? = null
val h : H? = null
fun test() {
a?.foo()
b?.foo()
c?.<error>foo</error>()
d?.<error>foo</error>()
e?.<error>foo</error>()
f?.<error>foo</error>()
g?.<error>foo</error>()
h?.<error>foo</error>()
}