Files
kotlin-fork/compiler/testData/diagnostics/tests/sealed/Local.kt
T
Kirill Rakhman 2d4646a285 [FIR] Fix false negative sealed diagnostics
... in presence of typealiases.

#KT-61921
2023-09-18 12:13:02 +00:00

18 lines
573 B
Kotlin
Vendored

// FIR_IDENTICAL
typealias TA = Sealed
sealed class Sealed {
object First: Sealed()
open class NonFirst: Sealed() {
object Second: NonFirst()
object Third: NonFirst()
fun foo(): Int {
val s = object: <!SEALED_SUPERTYPE_IN_LOCAL_CLASS!>Sealed<!>() {}
val s2 = object: <!SEALED_SUPERTYPE_IN_LOCAL_CLASS!>TA<!>() {}
class Local: <!SEALED_SUPERTYPE_IN_LOCAL_CLASS!>Sealed<!>() {}
return s.hashCode()
}
}
val p: Sealed = object: <!SEALED_SUPERTYPE_IN_LOCAL_CLASS!>Sealed<!>() {}
}