Files
kotlin-fork/compiler/testData/ir/irText/fakeOverrides/java21/sequenceSetIntersectionOverrideKJK.fir.kt.txt
anzhela.sukhanova 82255d5ee8 [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>
2024-03-04 16:21:02 +00:00

80 lines
1.5 KiB
Kotlin
Vendored

abstract class A : SortedSet<Int>, Set<Int> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
abstract class B : SortedSet<Int>, Set<Int> {
override val size: Int
field = size
override get
constructor(size: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun first(): Int {
return 1
}
override fun reversed(): SortedSet<Int> {
return CHECK_NOT_NULL<Nothing>(arg0 = null)
}
}
abstract class C : SortedSet<Int?>, MutableSet<Int?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
abstract class D : SortedSet<Int?>, MutableSet<Int?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun addLast(e: Int?) {
}
override fun reversed(): SortedSet<Int?>? {
return CHECK_NOT_NULL<Nothing>(arg0 = null)
}
}
fun test(a: A, b: B, c: C, d: D) {
a.<get-size>() /*~> Unit */
a.add(element = 1) /*~> Unit */
a.remove(element = 1) /*~> Unit */
a.addFirst(p0 = 1)
a.addLast(p0 = null)
a.removeFirst() /*~> Unit */
a.removeLast() /*~> Unit */
a.reversed() /*~> Unit */
a.getFirst() /*~> Unit */
b.reversed() /*~> Unit */
b.getFirst() /*~> Unit */
c.<get-size>() /*~> Unit */
c.add(element = 1) /*~> Unit */
c.remove(element = 1) /*~> Unit */
c.addFirst(p0 = 1)
c.addLast(p0 = null)
c.removeFirst() /*~> Unit */
c.removeLast() /*~> Unit */
c.reversed() /*~> Unit */
c.getFirst() /*~> Unit */
d.reversed() /*~> Unit */
d.addLast(e = null)
}