82255d5ee8
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
43 lines
1.2 KiB
Kotlin
Vendored
43 lines
1.2 KiB
Kotlin
Vendored
abstract class C<T : Any?> : SortedMap<T, T> {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
abstract class D<T : Any?> : SortedMap<T, T> {
|
|
override val size: Int
|
|
field = size
|
|
override get
|
|
|
|
constructor(size: Int) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
override fun remove(key: T): T? {
|
|
return null
|
|
}
|
|
|
|
}
|
|
|
|
fun test(c: C<Boolean>, d: D<Boolean>) {
|
|
c.<get-size>() /*~> Unit */
|
|
c.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = false, value = false)
|
|
c.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = null, value = null)
|
|
c.remove(key = null) /*~> Unit */
|
|
c.remove(key = true) /*~> Unit */
|
|
c.get(key = null) /*~> Unit */
|
|
c.get(key = true) /*~> Unit */
|
|
d.<get-size>() /*~> Unit */
|
|
d.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = false, value = false)
|
|
d.set<@FlexibleNullability Boolean?, @FlexibleNullability Boolean?>(key = null, value = null)
|
|
d.remove<Boolean?, @FlexibleNullability Boolean?>(key = null) /*~> Unit */
|
|
d.remove(key = true) /*~> Unit */
|
|
d.get(key = null) /*~> Unit */
|
|
d.get(key = true) /*~> Unit */
|
|
}
|