[Test] KT-61360: add tests for the IrFakeOverrideBuilder
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
30aae741a6
commit
82255d5ee8
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_STDLIB
|
||||
// SEPARATE_SIGNATURE_DUMP_FOR_K2
|
||||
// ^ ISSUE: KT-65667
|
||||
|
||||
// FILE: 1.kt
|
||||
import java.util.HashMap
|
||||
import java.util.SortedMap
|
||||
|
||||
abstract class A<T> : SortedMap<T, T>, HashMap<T, T>()
|
||||
|
||||
abstract class B<T> : SortedMap<T, T>, HashMap<T, T>() {
|
||||
override fun put(key: T, value: T): T? {
|
||||
return null!!
|
||||
}
|
||||
|
||||
override fun remove(key: T): T {
|
||||
return null!!
|
||||
}
|
||||
}
|
||||
|
||||
fun test(a: A<Boolean>, b: B<Boolean?>) {
|
||||
a.size
|
||||
a[true] = true
|
||||
a.put(null, null)
|
||||
a.get(true)
|
||||
a.get(null)
|
||||
a.remove(null)
|
||||
a.remove(true)
|
||||
|
||||
b.put(false, false)
|
||||
b[true] = true
|
||||
b.remove(null)
|
||||
}
|
||||
Reference in New Issue
Block a user