KT-303 Stack overflow on a cyclic class hierarchy
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user