Files
kotlin-fork/compiler/testData/codegen/box/collections/removeOverriddenInJava_Map.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

25 lines
726 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: removeOverriddenInJava_Map.kt
open class MapA : Map<String, String> {
override val entries: Set<Map.Entry<String, String>> get() = null!!
override val keys: Set<String> get() = null!!
override val size: Int get() = null!!
override val values: Collection<String> get() = null!!
override fun containsKey(key: String): Boolean = null!!
override fun containsValue(value: String): Boolean = null!!
override fun get(key: String): String? = null!!
override fun isEmpty(): Boolean = null!!
}
fun box() = MapB().remove("OK")
// FILE: MapB.java
public class MapB extends MapA {
@Override
public String remove(Object key) {
return (String) key;
}
}