A new test for alt-headers

This commit is contained in:
Andrey Breslav
2012-01-31 11:40:56 +04:00
parent 1b88be725a
commit 6f97101810
@@ -0,0 +1,34 @@
// +JDK
package std1
import java.util.*
fun main(args : Array<String>) {
val al : ArrayList<Int> = ArrayList<Int>
val al1 = ArrayList<Int>(1)
// for (x in al1) {
//
// }
val <!UNUSED_VARIABLE!>al2<!> = ArrayList<Int>(ArrayList<Int>)
al : RandomAccess
al.clear() : Unit
al.add(1) : Boolean
al.add(0, 1) : Unit
al.addAll(al1) : Boolean
al.addAll(0, al1) : Boolean
al.get(0) : Int
al.clone() : Object // A type mismatch on this line means that alt-headers were not loaded
al.toArray(Array<Int>(3, {1})) : Array<Int> // ^^^ same for this line
val m = HashMap<String, Int>()
m.put("", 1)
test(al, m)
}
fun test(a : List<Int>, m : Map<String, Int>) {
System.out?.println(
a.get(0) + 1
)
HashMap<Int, Int>().get(0)
if (m.get("") != null)
System.out?.println(m.get("").sure().plus(1))
}