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