Serialization of flexible types supported

This commit is contained in:
Andrey Breslav
2014-10-11 01:10:39 +04:00
parent e76df4db11
commit 070a7d4d72
28 changed files with 1643 additions and 438 deletions
@@ -0,0 +1,7 @@
package test
import java.util.*
fun printStream() = System.out
fun list() = Collections.emptyList<String>()
fun array(a: Array<Int>) = Arrays.copyOf(a, 2)
@@ -0,0 +1,22 @@
import java.io.PrintStream
import java.util.ArrayList
import test.*
// To check that flexible types are loaded
class Inv<T>
fun <T> inv(t: T): Inv<T> = Inv<T>()
fun main(args: Array<String>) {
printStream().checkError()
val p: Inv<PrintStream> = inv(printStream())
val p1: Inv<PrintStream?> = inv(printStream())
list().size()
val l: Inv<List<String>> = inv(list())
val l1: Inv<MutableList<String>?> = inv(list())
val a = array(Array<Int>(1){0})
a[0] = 1
val a1: Inv<Array<Int>> = inv(a)
val a2: Inv<Array<out Int>?> = inv(a)
}
@@ -0,0 +1,8 @@
//ALLOW_AST_ACCESS
package test
import java.util.*
fun printStream() = System.out
fun list() = Collections.emptyList<String>()
fun array(a: Array<Int>) = Arrays.copyOf(a, 2)
@@ -0,0 +1,5 @@
package test
internal fun array(/*0*/ a: kotlin.Array<kotlin.Int>): kotlin.Array<(out) kotlin.Int!>!
internal fun list(): kotlin.(Mutable)List<kotlin.String!>!
internal fun printStream(): java.io.PrintStream!