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