K2: serialize data class equals / hashCode / toString functions
#KT-57510 Fixed
This commit is contained in:
committed by
Space Team
parent
0a38b29491
commit
563781a246
@@ -42,6 +42,14 @@ inline fun <reified T> test(vararg names: String) {
|
||||
assertEquals(names.toSet(), T::class.declaredMembers.map { it.name }.toSet())
|
||||
}
|
||||
|
||||
data class D(val x: Int)
|
||||
|
||||
open class O<T>(val y: T)
|
||||
data class DO(val z: Int) : O<Int>(2 * z)
|
||||
|
||||
@JvmInline
|
||||
value class V(val b: Boolean)
|
||||
|
||||
fun box(): String {
|
||||
class Local : L() {
|
||||
fun publicLocalFun() {}
|
||||
@@ -55,6 +63,9 @@ fun box(): String {
|
||||
test<K>("publicKFun", "privateKFun", "publicKProp", "privateKProp")
|
||||
test<L>("publicLFun", "privateLFun", "publicLProp", "privateLProp")
|
||||
test<Local>("publicLocalFun", "privateLocalFun", "publicLocalProp", "privateLocalProp")
|
||||
test<D>("x", "component1", "copy", "equals", "hashCode", "toString")
|
||||
test<DO>("z", "component1", "copy", "equals", "hashCode", "toString")
|
||||
test<V>("b", "equals", "hashCode", "toString")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user