Files
kotlin-fork/compiler/testData/diagnostics/tests/cast/DowncastMap.kt
T
2013-09-05 14:17:33 +04:00

10 lines
175 B
Kotlin

trait Map<K, out V>
trait MutableMap<K, V>: Map<K, V> {
fun set(k: K, v: V)
}
fun p(p: Map<String, Int>) {
if (p is MutableMap<String, Int>) {
p[""] = 1
}
}