KT-303 Stack overflow on a cyclic class hierarchy

This commit is contained in:
Andrey Breslav
2011-09-13 17:17:45 +04:00
parent 261f88c215
commit 910ba57f8a
6 changed files with 222 additions and 42 deletions
+30
View File
@@ -0,0 +1,30 @@
open trait A {
fun foo() {}
}
open trait B : A, <error>E</error> {}
open trait C : B {}
open trait D : <error>B</error> {}
open trait E : <error>F</error> {}
open trait F : <error>D</error>, C {}
open trait G : F {}
open 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?.foo()
d?.foo()
e?.<error>foo</error>()
f?.foo()
g?.foo()
h?.foo()
}
@@ -0,0 +1,11 @@
// KT-303 Stack overflow on a cyclic class hierarchy
open class Foo() : <error>Bar</error>() {
val a : Int = 1
}
open class Bar() : <error>Foo</error>() {
}
val x : Int = <error>Foo()</error>