mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
29 lines
633 B
Kotlin
Vendored
29 lines
633 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_RUNTIME
|
|
|
|
import java.io.*
|
|
import kotlin.test.*
|
|
|
|
class Foo(val prop: String) {
|
|
fun method() {}
|
|
}
|
|
|
|
fun box(): String {
|
|
val baos = ByteArrayOutputStream()
|
|
val oos = ObjectOutputStream(baos)
|
|
oos.writeObject(Foo::prop)
|
|
oos.writeObject(Foo::method)
|
|
oos.writeObject(::Foo)
|
|
oos.close()
|
|
|
|
val bais = ByteArrayInputStream(baos.toByteArray())
|
|
val ois = ObjectInputStream(bais)
|
|
assertEquals(Foo::prop, ois.readObject())
|
|
assertEquals(Foo::method, ois.readObject())
|
|
assertEquals(::Foo, ois.readObject())
|
|
ois.close()
|
|
|
|
return "OK"
|
|
}
|