[FIR] Add diagnostic for constructor delegation cycles

This commit is contained in:
Nick
2020-07-31 16:48:33 +03:00
committed by Mikhail Glukhikh
parent e841b3a77b
commit bb0e1b7390
24 changed files with 322 additions and 58 deletions
@@ -1,9 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A(x: String = "", y: String = "") {
constructor(x: String, y: String): this(x, y)
constructor(): this("", "")
constructor(): this("", "")
constructor(x: String, y: String): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(x, y)
constructor(): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>("", "")
constructor(): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>("", "")
}
class B {
@@ -14,9 +14,9 @@ fun B(x: Int) {}
class Outer {
class A(x: String = "", y: String = "") {
constructor(x: String, y: String): this(x, y)
constructor(): this("", "")
constructor(): this("", "")
constructor(x: String, y: String): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(x, y)
constructor(): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>("", "")
constructor(): <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>("", "")
}
class B {