82255d5ee8
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
61 lines
1.4 KiB
Kotlin
Vendored
61 lines
1.4 KiB
Kotlin
Vendored
abstract class A : Java1 {
|
|
constructor() /* primary */ {
|
|
super/*Java1*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
abstract class B : Java1 {
|
|
constructor() /* primary */ {
|
|
super/*Java1*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
override operator fun get(key: Boolean?): Boolean? {
|
|
return true
|
|
}
|
|
|
|
override fun isEmpty(): Boolean {
|
|
return true
|
|
}
|
|
|
|
override val size: Int
|
|
override get(): Int {
|
|
return 5
|
|
}
|
|
|
|
}
|
|
|
|
abstract class KotlinClass : SortedMap<Boolean, Boolean> {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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 */
|
|
a.isNotEmpty<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>() /*~> Unit */
|
|
b.<get-size>() /*~> Unit */
|
|
b.put(key = false, value = false) /*~> Unit */
|
|
b.put(key = null, value = null) /*~> Unit */
|
|
b.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = null, value = null)
|
|
b.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = true, value = true)
|
|
b.get(key = null) /*~> Unit */
|
|
b.get(key = true) /*~> Unit */
|
|
b.remove(key = null) /*~> Unit */
|
|
b.remove(key = true) /*~> Unit */
|
|
b.isEmpty() /*~> Unit */
|
|
}
|