[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
@@ -7,7 +7,7 @@ class Foo {
bar = ""
}
constructor(a: Int) : this(a) {
constructor(a: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(a) {
bar = "a"
}
}
@@ -7,12 +7,12 @@ class Foo {
bar = ""
}
constructor(a: Int) : this(a, 0, 0) {
constructor(a: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(a, 0, 0) {
}
constructor(a: Int, b: Int) : this(a) {
constructor(a: Int, b: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(a) {
}
constructor(a: Int, b: Int, c: Int) : this(a, b) {
constructor(a: Int, b: Int, c: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(a, b) {
}
}