tests changes after collections mapping

This commit is contained in:
Svetlana Isakova
2012-09-04 17:03:39 +04:00
parent 2cad93e4be
commit 7d37df5f38
65 changed files with 75 additions and 114 deletions
@@ -1,7 +1,7 @@
import java.util.*
fun box(): String {
val map: Map<String, Int> = HashMap<String, Int>()
val map: MutableMap<String, Int> = HashMap<String, Int>()
map.put("a", 1)
map.put("bb", 2)
map.put("ccc", 3)
@@ -1,7 +1,7 @@
import java.util.ArrayList
class IntArrayList(): ArrayList<Int>() {
override fun get(index: Int): Int = super.get(index)!!
override fun get(index: Int): Int = super.get(index)
}
fun box(): String {
@@ -2,7 +2,7 @@ import java.util.AbstractList
class MyList(): AbstractList<String>() {
public fun getModificationCount(): Int = modCount
public override fun get(index: Int): String? = ""
public override fun get(index: Int): String = ""
public override fun size(): Int = 0
}
@@ -1,6 +1,6 @@
import java.util.*
fun <K, V> Map<K, V>.set(k : K, v : V) = put(k, v)
fun <K, V> MutableMap<K, V>.set(k : K, v : V) = put(k, v)
fun box() : String {
val map = HashMap<String,String>()
@@ -1,7 +1,7 @@
import java.util.ArrayList
class N() : ArrayList<Any>() {
override fun add(el: Any?) : Boolean {
override fun add(el: Any) : Boolean {
if (!super<ArrayList>.add(el)) {
throw Exception()
}