Setup default values for type-safe bridges
#KT-9973 In Progress
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
private object EmptyMap : Map<Any, Nothing> {
|
||||
override val size: Int get() = 0
|
||||
override fun isEmpty(): Boolean = true
|
||||
|
||||
override fun containsKey(key: Any): Boolean = false
|
||||
override fun containsValue(value: Nothing): Boolean = false
|
||||
override fun get(key: Any): Nothing? = null
|
||||
override val entries: Set<Map.Entry<String, Nothing>> get() = null!!
|
||||
override val keys: Set<String> get() = null!!
|
||||
override val values: Collection<Nothing> get() = null!!
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val n = EmptyMap as Map<Any?, Any?>
|
||||
|
||||
if (n.get(null) != null) return "fail 1"
|
||||
if (n.containsKey(null)) return "fail 2"
|
||||
if (n.containsValue(null)) return "fail 3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user