Files
kotlin-fork/compiler/testData/codegen/box/specialBuiltins/maps.kt
T
Mikhail Glukhikh 672b5ba0d7 K2/Java: implement platform-dependent function filtering in JvmMappedScope
We drop Kotlin function 'remove' or 'getOrDefault' from JvmMappedScope,
if it has platform-dependent annotation, and the bound Java class scope
does not contain a function with the same signature.

#KT-57268 Fixed
2024-01-30 19:44:00 +00:00

41 lines
985 B
Kotlin
Vendored

class A : Map<String, String> {
override val size: Int get() = 56
override fun isEmpty(): Boolean {
throw UnsupportedOperationException()
}
override fun containsKey(key: String): Boolean {
throw UnsupportedOperationException()
}
override fun containsValue(value: String): Boolean {
throw UnsupportedOperationException()
}
override fun get(key: String): String? {
throw UnsupportedOperationException()
}
override val keys: Set<String> get() {
throw UnsupportedOperationException()
}
override val values: Collection<String> get() {
throw UnsupportedOperationException()
}
override val entries: Set<Map.Entry<String, String>> get() {
throw UnsupportedOperationException()
}
}
fun box(): String {
val a = A()
if (a.size != 56) return "fail 1: ${a.size}"
val x: Map<String, String> = a
if (x.size != 56) return "fail 2: ${x.size}"
return "OK"
}