mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
24 lines
484 B
Kotlin
Vendored
24 lines
484 B
Kotlin
Vendored
// !LANGUAGE: -DataClassInheritance
|
|
|
|
interface Allowed
|
|
|
|
open class NotAllowed
|
|
|
|
abstract data class Base(val x: Int)
|
|
|
|
class Derived: Base(42)
|
|
|
|
data class Nasty(val z: Int, val y: Int): Base(z)
|
|
|
|
data class Complex(val y: Int): Allowed, NotAllowed()
|
|
|
|
|
|
|
|
interface AbstractEqualsHashCodeToString {
|
|
override fun equals(other: Any?): Boolean
|
|
override fun hashCode(): Int
|
|
override fun toString(): String
|
|
}
|
|
|
|
data class ImplInterface(val s: String) : AbstractEqualsHashCodeToString
|