592baee852
This fixes a scenario when INVISIBLE_REFERENCE is suppressed, but we
resolved to the wrong overload because when none of the candidates were
applicable, more or less the first one was chosen.
Because we call `fullyProcessCandidate` on the candidates, their
applicability can change which can lead to a situation where the
applicability of a ConeAmbiguityError is different to all its
candidates. The changes in coneDiagnosticToFirDiagnostic.kt account for
that, otherwise code like candidates.first { it.applicability ==
CandidateApplicability.UNSAFE_CALL } can throw NoSuchElementException.
#KT-57776 Fixed
13 lines
207 B
Kotlin
Vendored
13 lines
207 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
|
|
class A {
|
|
private fun foo(i: Int) {}
|
|
private fun foo(s: String) {}
|
|
}
|
|
|
|
fun test(a: A) {
|
|
a.<!INVISIBLE_REFERENCE!>foo<!>(3)
|
|
a.<!NONE_APPLICABLE!>foo<!>()
|
|
}
|
|
|