9dd8eda1c9
Library methods such as 'listOf' are resolved to have the package fragments as their parents, but JVM expects their containing file classes as parents. This fix generates those file classes and uses them as parent replacements for such library methods.
29 lines
615 B
Kotlin
Vendored
29 lines
615 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// FULL_JDK
|
|
// WITH_REFLECT
|
|
|
|
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"
|
|
}
|