Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt
T
Kirill Rakhman b2fa104081 [FIR] Keep all failed resolution candidates and fully resolve them
Previously, when a candidate was found with an applicability that is
better than the current best applicability, all previous candidates were
thrown away. Now we keep them, unless the new applicability is
successful. If no successful candidates are found, we fully resolve all
the unsuccessful ones and select the ones with the least bad
applicability. This improves diagnostics for unresolved calls.

#KT-57844 Fixed
2023-05-10 11:48:58 +00:00

28 lines
661 B
Kotlin
Vendored

fun <K> materialize(): K = null!!
open class A1(val x: String)
class B1 : A1(materialize())
open class A2(val x: Int)
class B2 : A2(1 + 1)
open class A3(x: String, y: String = "") {
constructor(x: String, b: Boolean = true) : this(x, x)
}
class B3_1 : <!OVERLOAD_RESOLUTION_AMBIGUITY!>A3<!>("")
class B3_2 : A3("", "asas")
class B3_3 : A3("", true)
class B3_4 : <!NONE_APPLICABLE!>A3<!>("", Unit)
open class A4(val x: Byte)
class B4 : A4( <!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>)
open class A5 {
constructor(x: Byte)
constructor(x: Short)
}
class B5_1 : A5(<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>)
class B5_2 : A5(<!ARGUMENT_TYPE_MISMATCH!>100 * 2<!>)