10 lines
291 B
Kotlin
Vendored
10 lines
291 B
Kotlin
Vendored
sealed class Sealed(val x: Int) {
|
|
object First: Sealed(12)
|
|
open class NonFirst(x: Int, val y: Int): Sealed(x) {
|
|
object Second: NonFirst(34, 2)
|
|
object Third: NonFirst(56, 3)
|
|
// It's ALLOWED to inherit Sealed also here
|
|
object Fourth: Sealed(78)
|
|
}
|
|
}
|