[FIR] Change priority of K2_VISIBILITY_ERROR CandidateApplicability

In K1 analogue of `K2_VISIBILITY_ERROR` is `K1_RUNTIME_ERROR`, so
  candidates with `K2_VISIBILITY_ERROR` should win over innaplicable
  candidates with `INAPPLICABLE`, `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR`
  or `INAPPLICABLE_WRONG_RECEIVER` applicability

This is needed to allow resolution to invisible symbols (and later
  suppress error with `@Suppress("INVISIBLE_SYMBOL", "INVISIBLE_REFERENCE")`

^KT-55026 Fixed
^KT-55234
This commit is contained in:
Dmitriy Novozhilov
2022-12-01 13:15:51 +02:00
committed by Space Team
parent 6c6525ecde
commit f3da26946b
25 changed files with 67 additions and 94 deletions
@@ -12,7 +12,7 @@ FILE: singletonConstructors.kt
}
public final fun foo(): R|kotlin/Unit| {
<HIDDEN: /A.Comp.Comp is invisible>#()
<HIDDEN: /A.Comp.Comp is deprecated with DeprecationLevel.HIDDEN>#()
}
}
@@ -21,7 +21,7 @@ FILE: singletonConstructors.kt
super<R|kotlin/Any|>()
}
private final val x: R|B| = <HIDDEN: /B.B is invisible>#()
private final val x: R|B| = <HIDDEN: /B.B is deprecated with DeprecationLevel.HIDDEN>#()
private get(): R|B|
}
@@ -2,12 +2,12 @@ class A {
companion object Comp {}
fun foo() {
<!INVISIBLE_REFERENCE!>Comp<!>()
<!UNRESOLVED_REFERENCE!>Comp<!>()
}
}
object B {
private val x = <!INVISIBLE_REFERENCE!>B<!>()
private val x = <!UNRESOLVED_REFERENCE!>B<!>()
}
class D {