Refine generic signature for Map.get/remove

Before this change generic signature wasn't written because of wrong
assumption about it absence in all cases where we replace generic parameter
with Object
This commit is contained in:
Denis Zharkov
2015-11-24 17:19:15 +03:00
parent 20cbceb56d
commit 6292833a69
8 changed files with 73 additions and 27 deletions
@@ -0,0 +1,24 @@
open class KMap<K, V> : Map<K, V> {
override val size: Int
get() = throw UnsupportedOperationException()
override fun isEmpty(): Boolean {
throw UnsupportedOperationException()
}
override fun containsKey(key: K) = true
override fun containsValue(value: V) = true
override fun get(key: K): V? {
throw UnsupportedOperationException()
}
override val keys: Set<K>
get() = throw UnsupportedOperationException()
override val values: Collection<V>
get() = throw UnsupportedOperationException()
override val entries: Set<Map.Entry<K, V>>
get() = throw UnsupportedOperationException()
}
fun box() = J.foo()