Files
kotlin-fork/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.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

25 lines
712 B
Kotlin
Vendored

object A1<!CONSTRUCTOR_IN_OBJECT!>()<!> {
<!CONSTRUCTOR_IN_OBJECT!>constructor(x: Int = "", y: Int)<!> : <!UNRESOLVED_REFERENCE!>this<!>() {
x + y
}
}
object A2 public <!CONSTRUCTOR_IN_OBJECT!>constructor(private val prop: Int)<!> {
<!CONSTRUCTOR_IN_OBJECT!>constructor(x: Int = "", y: Int)<!> : <!NONE_APPLICABLE!>this<!>(x * y) {
x + y
}
}
val x = object <!CONSTRUCTOR_IN_OBJECT!>(val prop: Int)<!> {
<!CONSTRUCTOR_IN_OBJECT!>constructor()<!> : this(1) {
val x = 1
x * x
}
}
class A3 {
companion object B<!CONSTRUCTOR_IN_OBJECT!>(val prop: Int)<!> {
public <!CONSTRUCTOR_IN_OBJECT!>constructor()<!> : <!NONE_APPLICABLE!>this<!>(2)
}
}