Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/sealedClass.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

11 lines
322 B
Kotlin
Vendored

sealed class Foo(val value: String)
class Bar : Foo("OK")
sealed class WithPrivateConstructor private constructor(val x: Int) {
private constructor() : this(42)
}
object First : <!INVISIBLE_REFERENCE!>WithPrivateConstructor<!>() // error
object Second : <!INVISIBLE_REFERENCE!>WithPrivateConstructor<!>(0) // error