tests changes after collections mapping
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user