Files
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

167 lines
3.1 KiB
Kotlin
Vendored

abstract enum class A : Enum<A>, Java1 {
private constructor() /* primary */ {
super/*Enum*/<A>()
/* <init>() */
}
fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<A> /* Synthetic body for ENUM_VALUES */
val entries: EnumEntries<A>
get(): EnumEntries<A> /* Synthetic body for ENUM_ENTRIES */
}
open enum class B : Enum<B>, Java1 {
FIRST = FIRST()
private enum entry class FIRST : B {
private constructor() /* primary */ {
super/*B*/() /*~> Unit */
/* <init>() */
}
override fun foo(i: Int) {
}
}
SECOND = B()
private constructor() /* primary */ {
super/*Enum*/<B>()
/* <init>() */
}
fun valueOf(value: String): B /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<B> /* Synthetic body for ENUM_VALUES */
override fun foo(i: Int) {
}
val entries: EnumEntries<B>
get(): EnumEntries<B> /* Synthetic body for ENUM_ENTRIES */
}
enum class C : Enum<C>, Java2 {
private constructor() /* primary */ {
super/*Enum*/<C>()
/* <init>() */
}
fun valueOf(value: String): C /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<C> /* Synthetic body for ENUM_VALUES */
val entries: EnumEntries<C>
get(): EnumEntries<C> /* Synthetic body for ENUM_ENTRIES */
}
open enum class D : Enum<D>, Java2 {
FIRST = FIRST()
private enum entry class FIRST : D {
private constructor() /* primary */ {
super/*D*/() /*~> Unit */
/* <init>() */
}
override fun foo(i: Int) {
}
}
private constructor() /* primary */ {
super/*Enum*/<D>()
/* <init>() */
}
fun valueOf(value: String): D /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<D> /* Synthetic body for ENUM_VALUES */
override fun foo(i: Int) {
}
val entries: EnumEntries<D>
get(): EnumEntries<D> /* Synthetic body for ENUM_ENTRIES */
}
abstract enum class E : Enum<E>, Java1, Java3 {
private constructor() /* primary */ {
super/*Enum*/<E>()
/* <init>() */
}
fun valueOf(value: String): E /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<E> /* Synthetic body for ENUM_VALUES */
val entries: EnumEntries<E>
get(): EnumEntries<E> /* Synthetic body for ENUM_ENTRIES */
}
abstract enum class F : Enum<F>, Java1, Java3 {
FIRST = FIRST()
private enum entry class FIRST : F {
private constructor() /* primary */ {
super/*F*/() /*~> Unit */
/* <init>() */
}
override fun foo(i: Int?) {
}
}
private constructor() /* primary */ {
super/*Enum*/<F>()
/* <init>() */
}
fun valueOf(value: String): F /* Synthetic body for ENUM_VALUEOF */
fun values(): Array<F> /* Synthetic body for ENUM_VALUES */
override fun foo(i: Any) {
}
val entries: EnumEntries<F>
get(): EnumEntries<F> /* Synthetic body for ENUM_ENTRIES */
}
interface KotlinInterface {
fun foo(i: Int) {
}
}
fun test() {
B.FIRST.foo(i = 1)
B.SECOND.foo(i = 1)
B.FIRST.<get-ordinal>() /*~> Unit */
D.FIRST.foo(i = 1)
D.FIRST.<get-ordinal>() /*~> Unit */
F.FIRST.foo(i = 1)
F.FIRST.foo(i = "")
F.FIRST.foo(i = null)
F.FIRST.<get-ordinal>() /*~> Unit */
}