Files
kotlin-fork/compiler/testData/diagnostics/tests/overload/overloadsFromCurrentAndSuperClass.kt
T
Denis.Zharkov b4b443034f K2: Fix false-positive OVERLOAD_RESOLUTION_AMBIGUITY
It's been introduced in the previous commit
("K2: Simplify handling mixed smartcast vs. original candidates")

Because previously, it was assumed wrongly that each next level of
ConeCallConflictResolver filter out the candidates that are 100% less
applicable/specific, but the main one (ConeOverloadConflictResolver)
either leaves the single candidate or the whole same set, thus at
FilteringOutOriginalInPresenceOfSmartCastConeCallConflictResolver
we've got 4 candidates only two of which we might filter out.
2023-02-15 08:13:57 +00:00

24 lines
324 B
Kotlin
Vendored

// SKIP_TXT
// FIR_IDENTICAL
abstract class A {
open public fun foo(x: Any) {}
open public fun foo(x: String) {}
}
class B : A() {
override fun foo(x: Any) {
super.foo(x)
}
override fun foo(x: String) {
super.foo(x)
}
}
fun bar(a: A) {
if (a is B) {
a.foo("")
}
}