Files
kotlin-fork/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.kt
T
Mikhail Zarechenskiy bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00

13 lines
266 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// KT-303 Stack overflow on a cyclic class hierarchy
open class Foo() : <!CYCLIC_INHERITANCE_HIERARCHY!>Bar<!>() {
val a : Int = 1
}
open class Bar() : <!CYCLIC_INHERITANCE_HIERARCHY!>Foo<!>() {
}
val x : Int = <!TYPE_MISMATCH!>Foo()<!>