Files
kotlin-fork/compiler/testData/codegen/box/callableReference/serializability/boundWithNotSerializableReceiver.kt
T
Alexander Udalov 1ee2053a16 Make callable references Serializable on JVM
#KT-11254 Fixed
2017-02-16 18:00:18 +03:00

20 lines
431 B
Kotlin
Vendored

// IGNORE_BACKEND: JS
// WITH_REFLECT
// FULL_JDK
import java.io.*
import kotlin.test.*
class Foo(val value: String)
fun box(): String {
val oos = ObjectOutputStream(ByteArrayOutputStream())
try {
oos.writeObject(Foo("abacaba")::value)
return "Fail: Foo is not Serializable and thus writeObject should have thrown an exception"
}
catch (e: NotSerializableException) {
return "OK"
}
}