FIR: forbid reporting inapplicable-likes on implicit constructors

This commit is contained in:
Mikhail Glukhikh
2021-02-18 12:55:29 +03:00
parent 34c90aab3b
commit 239a44b30c
11 changed files with 16 additions and 27 deletions
@@ -8,7 +8,7 @@ expect open class A {
}
expect class B : A {
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor(i: Int)<!>
<!EXPLICIT_DELEGATION_CALL_REQUIRED!>constructor(i: Int)<!>
constructor() : super("B")
}
@@ -2,7 +2,7 @@
open class B0(x: Int)
class A0 : B0 {
<!INAPPLICABLE_CANDIDATE!>constructor()<!>
constructor()
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>()
}
@@ -26,7 +26,7 @@ open class B2 {
}
class A2 : B2 {
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor()<!>
<!EXPLICIT_DELEGATION_CALL_REQUIRED!>constructor()<!>
constructor(x: Int) : <!NONE_APPLICABLE!>super<!>()
}
@@ -37,6 +37,6 @@ open class B3 {
}
class A3 : B3 {
<!HIDDEN!>constructor()<!>
constructor()
constructor(x: Int) : <!HIDDEN!>super<!>()
}
@@ -1,7 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class A(p1: String)
class B() : A("") {
<!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>constructor(s: String)<!><!INAPPLICABLE_CANDIDATE!><!> {
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class A(p1: String)
@@ -2,6 +2,6 @@ class A {
open inner class Inner
class Nested : Inner {
constructor()<!UNRESOLVED_REFERENCE!><!>
constructor()
}
}
@@ -2,5 +2,5 @@
open class A(p1: String, p2: String, p3: String, p4: String, p5: String)
class B : A {
constructor(s: String)<!INAPPLICABLE_CANDIDATE!><!>
constructor(s: String)
}
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class B(x: Double) {
constructor(x: Int): this(1.0)
constructor(x: String): this(1.0)
}
interface C
class A : B, C {
constructor(): <!NONE_APPLICABLE!>super<!>(' ')
<!EXPLICIT_DELEGATION_CALL_REQUIRED, NONE_APPLICABLE!>constructor(x: Int)<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class B(x: Double) {
constructor(x: Int): this(1.0)