[FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible

Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
This commit is contained in:
Dmitriy Novozhilov
2020-07-22 16:40:14 +03:00
committed by Mikhail Glukhikh
parent 5c0528b61e
commit f283f2db43
365 changed files with 1400 additions and 1451 deletions
@@ -17,7 +17,7 @@ class A : B {
<!INAPPLICABLE_CANDIDATE!>foo<!>(x, y, myProp)
x + y + myProp + parentProp + super.parentProp
}
constructor(x: B, y: Int = <!UNRESOLVED_REFERENCE!>global2<!>): <!INAPPLICABLE_CANDIDATE!>this<!>("", x) {
constructor(x: B, y: Int = <!UNRESOLVED_REFERENCE!>global2<!>): <!NONE_APPLICABLE!>this<!>("", x) {
x.parentProp + y + myProp + parentProp + super.parentProp
}
@@ -1,17 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
companion object {
fun foo(): Int = 1
val prop = 2
val C = 3
}
object B {
fun bar(): Int = 4
val prop = 5
}
object C {
}
constructor(x: Int)
constructor() : this(foo() + prop + B.bar() + B.prop <!INAPPLICABLE_CANDIDATE!>+<!> C)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
companion object {
@@ -19,7 +19,7 @@ val y2: B<Int> = B("")
val y3: B<Int> = B<Int>(1)
val y4: B<Int> = B<Int>("")
val y5: B<String> = <!INAPPLICABLE_CANDIDATE!>B<!><String>(1)
val y5: B<String> = <!NONE_APPLICABLE!>B<!><String>(1)
val y6: B<String> = B<String>("")
val y7: B<String> = B(1)
val y8: B<String> = B("")
@@ -5,7 +5,7 @@ object A {
enum class B {
X() {
<!CONSTRUCTOR_IN_OBJECT, INAPPLICABLE_CANDIDATE!>constructor()<!>
<!CONSTRUCTOR_IN_OBJECT, NONE_APPLICABLE!>constructor()<!>
}
}
@@ -17,4 +17,4 @@ class C {
val anonObject = object {
<!CONSTRUCTOR_IN_OBJECT!>constructor()<!>
}
}
@@ -26,8 +26,8 @@ open class B2 {
}
class A2 : B2 {
<!INAPPLICABLE_CANDIDATE!>constructor()<!>
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>()
<!NONE_APPLICABLE!>constructor()<!>
constructor(x: Int) : <!NONE_APPLICABLE!>super<!>()
}
// --------------------------
@@ -37,6 +37,6 @@ open class B3 {
}
class A3 : B3 {
<!INAPPLICABLE_CANDIDATE!>constructor()<!>
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>()
}
<!HIDDEN!>constructor()<!>
constructor(x: Int) : <!HIDDEN!>super<!>()
}
@@ -5,6 +5,6 @@ open class B(x: Double) {
}
interface C
class A : B, C {
constructor(): <!INAPPLICABLE_CANDIDATE!>super<!>(' ')
<!INAPPLICABLE_CANDIDATE!>constructor(x: Int)<!>
constructor(): <!NONE_APPLICABLE!>super<!>(' ')
<!NONE_APPLICABLE!>constructor(x: Int)<!>
}
@@ -1,8 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE
class A {
constructor(x: Int) {}
constructor(x: String) {}
constructor(): <!INAPPLICABLE_CANDIDATE!>this<!>('a') {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE