[FIR] Fix candidate success check by checking if no diagnostic is unsuccessful

Checking the current applicability isn't enough because in the presence
of multiple diagnostics, the lowest applicability can be successful but
a higher one isn't.

#KT-63147 Fixed
This commit is contained in:
Kirill Rakhman
2023-11-03 12:06:01 +01:00
committed by Space Team
parent 0d36462c58
commit 6b7eeec181
8 changed files with 75 additions and 10 deletions
@@ -0,0 +1,28 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER, -ERROR_SUPPRESSION
@DslMarker
annotation class Ann
@Ann
class A {
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.LowPriorityInOverloadResolution
fun a() = 1
}
@Ann
class B {
fun b() = 2
}
fun foo(x: A.() -> Unit) {}
fun bar(x: B.() -> Unit) {}
fun test() {
foo {
a()
bar {
<!DSL_SCOPE_VIOLATION!>a<!>()
}
}
}