[FIR] Implement RECURSIVE_TYPEALIAS_EXPANSION, CYCLIC_INHERITANCE_HIERARCHY diagnostics, fix stackoverlow exception in case if typealias points to type with type arguments
This commit is contained in:
committed by
teamcityserver
parent
d1531f9cdd
commit
c4c2fbb5a0
+5
-5
@@ -1,11 +1,11 @@
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
interface B : A, E {}
|
||||
interface C : <error descr="[OTHER_ERROR] Unknown (other) error">B</error> {}
|
||||
interface D : <error descr="[OTHER_ERROR] Unknown (other) error">B</error> {}
|
||||
interface E : F {}
|
||||
interface F : D, C {}
|
||||
interface B : A, <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">E</error> {}
|
||||
interface C : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">B</error> {}
|
||||
interface D : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">B</error> {}
|
||||
interface E : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">F</error> {}
|
||||
interface F : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">D</error>, <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">C</error> {}
|
||||
interface G : F {}
|
||||
interface H : F {}
|
||||
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// KT-303 Stack overflow on a cyclic class hierarchy
|
||||
|
||||
open class Foo() : Bar() {
|
||||
open class Foo() : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">Bar</error>() {
|
||||
val a : Int = 1
|
||||
}
|
||||
|
||||
open class Bar() : <error descr="[OTHER_ERROR] Unknown (other) error">Foo</error>() {
|
||||
open class Bar() : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">Foo</error>() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
class A : <error descr="[OTHER_ERROR] Unknown (other) error">A</error>() {}
|
||||
class A : <error descr="[CYCLIC_INHERITANCE_HIERARCHY] There's a cycle in the inheritance hierarchy for this type">A</error>() {}
|
||||
|
||||
val x : Int = <error descr="[INITIALIZER_TYPE_MISMATCH] Initializer type mismatch: expected kotlin/Int, actual A"><error descr="[TYPE_MISMATCH] Type mismatch: inferred type is A but kotlin/Int was expected">A()</error></error>
|
||||
|
||||
Reference in New Issue
Block a user