KT-4107 Data objects
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// LANGUAGE: +DataObjects
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
data object DataObject
|
||||
|
||||
val doppelganger = DataObject::class.java.declaredConstructors[0].apply { isAccessible = true }.newInstance()
|
||||
|
||||
fun box(): String {
|
||||
assertFalse(DataObject === doppelganger)
|
||||
assertEquals(DataObject, doppelganger)
|
||||
assertEquals(DataObject.hashCode(), DataObject::class.java.cast(doppelganger).hashCode())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user