[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
@@ -9,7 +9,7 @@ fun test() {
val interface_as_fun = <!RESOLUTION_TO_CLASSIFIER!>A<!>()
val interface_as_val = <!NO_COMPANION_OBJECT!>A<!>
val object_as_fun = <!INVISIBLE_REFERENCE!>B<!>()
val object_as_fun = <!UNRESOLVED_REFERENCE!>B<!>()
val class_as_val = <!NO_COMPANION_OBJECT!>C<!>
}
@@ -11,7 +11,7 @@ fun testX() {
val interface_as_fun = X.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
val interface_as_val = X.<!NO_COMPANION_OBJECT!>A<!>
val object_as_fun = X.<!INVISIBLE_REFERENCE!>B<!>()
val object_as_fun = X.<!UNRESOLVED_REFERENCE!>B<!>()
val class_as_val = X.<!NO_COMPANION_OBJECT!>C<!>
}
@@ -26,7 +26,7 @@ fun testY() {
val interface_as_fun = Y.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
val interface_as_val = Y.<!NO_COMPANION_OBJECT!>A<!>
val object_as_fun = Y.<!INVISIBLE_REFERENCE!>B<!>()
val object_as_fun = Y.<!UNRESOLVED_REFERENCE!>B<!>()
val class_as_val = Y.<!NO_COMPANION_OBJECT!>C<!>
}