82255d5ee8
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
39 lines
973 B
Kotlin
Vendored
39 lines
973 B
Kotlin
Vendored
abstract class A : SortedMap<Boolean, Boolean>, Map<Boolean, Boolean> {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
abstract class B : SortedMap<Boolean, Boolean>, Map<Boolean, Boolean> {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
override fun put(key: Boolean, value: Boolean): Boolean? {
|
|
return false
|
|
}
|
|
|
|
override fun remove(key: Boolean?): Boolean? {
|
|
return false
|
|
}
|
|
|
|
}
|
|
|
|
fun test(a: A, b: B) {
|
|
a.<get-size>() /*~> Unit */
|
|
a.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = true, value = true)
|
|
a.put(key = null, value = null) /*~> Unit */
|
|
a.get(key = true) /*~> Unit */
|
|
a.get(key = null) /*~> Unit */
|
|
a.remove(key = null) /*~> Unit */
|
|
a.remove(key = true) /*~> Unit */
|
|
b.put(key = false, value = false) /*~> Unit */
|
|
b.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = true, value = true)
|
|
b.remove(key = null) /*~> Unit */
|
|
}
|