82255d5ee8
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
493 lines
16 KiB
Kotlin
Vendored
493 lines
16 KiB
Kotlin
Vendored
// CHECK:
|
|
// Mangled name: MyAnnotation
|
|
// Public signature: /MyAnnotation|null[0]
|
|
open annotation class MyAnnotation : Annotation {
|
|
// CHECK:
|
|
// Mangled name: MyAnnotation#<init>(){}
|
|
// Public signature: /MyAnnotation.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: A
|
|
// Public signature: /A|null[0]
|
|
open class A {
|
|
// CHECK:
|
|
// Mangled name: A{}a
|
|
// Public signature: /A.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
@MyAnnotation
|
|
open val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: A#<get-a>(){}kotlin.Int
|
|
// Public signature: /A.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
open get
|
|
|
|
// CHECK:
|
|
// Mangled name: A#<init>(kotlin.Int){}
|
|
// Public signature: /A.<init>|-5182794243525578284[0]
|
|
// Public signature debug description: <init>(kotlin.Int){}
|
|
@MyAnnotation
|
|
constructor(i: Int)
|
|
|
|
// CHECK:
|
|
// Mangled name: A#foo(kotlin.Int){}
|
|
// Public signature: /A.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
@MyAnnotation
|
|
open fun foo(@MyAnnotation a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: A{}b
|
|
// Public signature: /A.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
open var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: A#<get-b>(){}kotlin.Int
|
|
// Public signature: /A.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
open get(): Int
|
|
// CHECK:
|
|
// Mangled name: A#<set-b>(kotlin.Int){}
|
|
// Public signature: /A.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
open set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: B
|
|
// Public signature: /B|null[0]
|
|
class B : Java1 {
|
|
// CHECK:
|
|
// Mangled name: B#<init>(){}
|
|
// Public signature: /B.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: B#foo(kotlin.Int){}
|
|
// Public signature: /B.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override fun foo(@MyAnnotation a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: B{}a
|
|
// Public signature: /B.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
@MyAnnotation
|
|
/* fake */ override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: B#<get-a>(){}kotlin.Int
|
|
// Public signature: /B.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
/* fake */ override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: B{}b
|
|
// Public signature: /B.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
/* fake */ override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: B#<get-b>(){}kotlin.Int
|
|
// Public signature: /B.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
/* fake */ override get(): Int
|
|
// CHECK:
|
|
// Mangled name: B#<set-b>(kotlin.Int){}
|
|
// Public signature: /B.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: C
|
|
// Public signature: /C|null[0]
|
|
class C : Java1 {
|
|
// CHECK:
|
|
// Mangled name: C#<init>(){}
|
|
// Public signature: /C.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: C#foo(kotlin.Int){}
|
|
// Public signature: /C.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
override fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: C{}a
|
|
// Public signature: /C.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: C#<get-a>(){}kotlin.Int
|
|
// Public signature: /C.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: C{}b
|
|
// Public signature: /C.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: C#<get-b>(){}kotlin.Int
|
|
// Public signature: /C.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
override get(): Int
|
|
// CHECK:
|
|
// Mangled name: C#<set-b>(kotlin.Int){}
|
|
// Public signature: /C.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: D
|
|
// Public signature: /D|null[0]
|
|
class D : Java2 {
|
|
// CHECK:
|
|
// Mangled name: D#<init>(){}
|
|
// Public signature: /D.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: D#foo(kotlin.Int){}
|
|
// Public signature: /D.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
@Override
|
|
/* fake */ override fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: D{}a
|
|
// Public signature: /D.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
/* fake */ override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: D#<get-a>(){}kotlin.Int
|
|
// Public signature: /D.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
@Override
|
|
/* fake */ override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: D{}b
|
|
// Public signature: /D.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
/* fake */ override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: D#<get-b>(){}kotlin.Int
|
|
// Public signature: /D.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
/* fake */ override get(): Int
|
|
// CHECK:
|
|
// Mangled name: D#<set-b>(kotlin.Int){}
|
|
// Public signature: /D.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: E
|
|
// Public signature: /E|null[0]
|
|
class E : Java2 {
|
|
// CHECK:
|
|
// Mangled name: E{}b
|
|
// Public signature: /E.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: E#<get-b>(){}kotlin.Int
|
|
// Public signature: /E.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
override get(): Int
|
|
// CHECK:
|
|
// Mangled name: E#<set-b>(kotlin.Int){}
|
|
// Public signature: /E.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
override set
|
|
|
|
// CHECK:
|
|
// Mangled name: E#<init>(){}
|
|
// Public signature: /E.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: E#foo(kotlin.Int){}
|
|
// Public signature: /E.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
override fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: E{}a
|
|
// Public signature: /E.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: E#<get-a>(){}kotlin.Int
|
|
// Public signature: /E.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
override get(): Int
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: F
|
|
// Public signature: /F|null[0]
|
|
abstract class F : Java1, Java3 {
|
|
// CHECK:
|
|
// Mangled name: F#<init>(){}
|
|
// Public signature: /F.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: F#foo(kotlin.Int){}
|
|
// Public signature: /F.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override fun foo(@MyAnnotation a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: F#setA(kotlin.Int){}
|
|
// Public signature: /F.setA|-2839184409429581850[0]
|
|
// Public signature debug description: setA(kotlin.Int){}
|
|
abstract /* fake */ override fun setA(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: F{}a
|
|
// Public signature: /F.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
@MyAnnotation
|
|
/* fake */ override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: F#<get-a>(){}kotlin.Int
|
|
// Public signature: /F.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
/* fake */ override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: F{}b
|
|
// Public signature: /F.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
/* fake */ override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: F#<get-b>(){}kotlin.Int
|
|
// Public signature: /F.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
/* fake */ override get(): Int
|
|
// CHECK:
|
|
// Mangled name: F#<set-b>(kotlin.Int){}
|
|
// Public signature: /F.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: G
|
|
// Public signature: /G|null[0]
|
|
class G : Java1, Java3 {
|
|
// CHECK:
|
|
// Mangled name: G#<init>(){}
|
|
// Public signature: /G.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: G#foo(kotlin.Int){}
|
|
// Public signature: /G.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
override fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: G#setA(kotlin.Int){}
|
|
// Public signature: /G.setA|-2839184409429581850[0]
|
|
// Public signature debug description: setA(kotlin.Int){}
|
|
override fun setA(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: G{}a
|
|
// Public signature: /G.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
@MyAnnotation
|
|
/* fake */ override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: G#<get-a>(){}kotlin.Int
|
|
// Public signature: /G.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
/* fake */ override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: G{}b
|
|
// Public signature: /G.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
/* fake */ override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: G#<get-b>(){}kotlin.Int
|
|
// Public signature: /G.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
/* fake */ override get(): Int
|
|
// CHECK:
|
|
// Mangled name: G#<set-b>(kotlin.Int){}
|
|
// Public signature: /G.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: H
|
|
// Public signature: /H|null[0]
|
|
class H : Java1, KotlinInterface {
|
|
// CHECK:
|
|
// Mangled name: H#<init>(){}
|
|
// Public signature: /H.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: H#foo(kotlin.Int){}
|
|
// Public signature: /H.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override fun foo(@MyAnnotation a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: H{}a
|
|
// Public signature: /H.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
@MyAnnotation
|
|
/* fake */ override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: H#<get-a>(){}kotlin.Int
|
|
// Public signature: /H.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
/* fake */ override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: H{}b
|
|
// Public signature: /H.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
/* fake */ override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: H#<get-b>(){}kotlin.Int
|
|
// Public signature: /H.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
@MyAnnotation
|
|
/* fake */ override get(): Int
|
|
// CHECK:
|
|
// Mangled name: H#<set-b>(kotlin.Int){}
|
|
// Public signature: /H.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
@MyAnnotation
|
|
/* fake */ override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: I
|
|
// Public signature: /I|null[0]
|
|
class I : Java1, KotlinInterface {
|
|
// CHECK:
|
|
// Mangled name: I#<init>(){}
|
|
// Public signature: /I.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK:
|
|
// Mangled name: I#foo(kotlin.Int){}
|
|
// Public signature: /I.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
override fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: I{}a
|
|
// Public signature: /I.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
override val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: I#<get-a>(){}kotlin.Int
|
|
// Public signature: /I.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
override get(): Int
|
|
|
|
// CHECK:
|
|
// Mangled name: I{}b
|
|
// Public signature: /I.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
override var b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: I#<get-b>(){}kotlin.Int
|
|
// Public signature: /I.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
override get(): Int
|
|
// CHECK:
|
|
// Mangled name: I#<set-b>(kotlin.Int){}
|
|
// Public signature: /I.b.<set-b>|393614520529327556[0]
|
|
// Public signature debug description: <set-b>(kotlin.Int){}
|
|
override set(value: Int): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface
|
|
// Public signature: /KotlinInterface|null[0]
|
|
interface KotlinInterface {
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface#foo(kotlin.Int){}
|
|
// Public signature: /KotlinInterface.foo|-104159190164110731[0]
|
|
// Public signature debug description: foo(kotlin.Int){}
|
|
abstract fun foo(a: Int): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface{}a
|
|
// Public signature: /KotlinInterface.a|-1200697420457237799[0]
|
|
// Public signature debug description: {}a
|
|
abstract val a: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: KotlinInterface#<get-a>(){}kotlin.Int
|
|
// Public signature: /KotlinInterface.a.<get-a>|4232747788241509192[0]
|
|
// Public signature debug description: <get-a>(){}kotlin.Int
|
|
abstract get
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface{}b
|
|
// Public signature: /KotlinInterface.b|772347207915745207[0]
|
|
// Public signature debug description: {}b
|
|
abstract val b: Int
|
|
// CHECK JVM_IR:
|
|
// Mangled name: KotlinInterface#<get-b>(){}kotlin.Int
|
|
// Public signature: /KotlinInterface.b.<get-b>|-2902143276921469679[0]
|
|
// Public signature debug description: <get-b>(){}kotlin.Int
|
|
abstract get
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: #test(B;C;D;E;F;G;H;I){}
|
|
// Public signature: /test|2768829396992774586[0]
|
|
// Public signature debug description: test(B;C;D;E;F;G;H;I){}
|
|
fun test(b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I): Unit
|