[FIR] Fix incorrect diagnostic behaviour + several enum diagnostics

This commit is contained in:
Nick
2020-08-03 18:01:58 +03:00
committed by Mikhail Glukhikh
parent b76f757d47
commit f74eb07203
18 changed files with 283 additions and 21 deletions
@@ -8,7 +8,7 @@ expect open class A {
}
expect class B : A {
<!NONE_APPLICABLE!>constructor(i: Int)<!>
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor(i: Int)<!>
constructor() : super("B")
}
@@ -7,8 +7,8 @@ data class A2(val y: String, val z: Int) {
constructor(x: String): this(x, 0)
}
data class A3 {
<!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS!>data class A3 {
constructor()
}
}<!>
data class A4 internal constructor()
@@ -6,7 +6,7 @@ enum class A {
constructor(x: Int)
constructor(x: Int, y: Int): this(x+y)
constructor(x: Double): this(x.toInt(), 1)
constructor(x: String): super(x, 1)
constructor(x: String): <!DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR!>super<!>(x, 1)
}
enum class B(x: Int) {
@@ -14,7 +14,7 @@ enum class B(x: Int) {
constructor(x: Int, y: Int): this(x+y)
constructor(x: Double): this(x.toInt(), 1)
constructor(x: String): <!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>super<!>(x, 1)
constructor(x: String): <!DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR, PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>super<!>(x, 1)
}
enum class C {
@@ -26,7 +26,7 @@ open class B2 {
}
class A2 : B2 {
<!NONE_APPLICABLE!>constructor()<!>
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor()<!>
constructor(x: Int) : <!NONE_APPLICABLE!>super<!>()
}
@@ -6,5 +6,5 @@ open class B(x: Double) {
interface C
class A : B, C {
constructor(): <!NONE_APPLICABLE!>super<!>(' ')
<!NONE_APPLICABLE!>constructor(x: Int)<!>
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor(x: Int)<!>
}