82255d5ee8
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
318 lines
9.9 KiB
Kotlin
Vendored
318 lines
9.9 KiB
Kotlin
Vendored
// CHECK:
|
|
// Mangled name: A
|
|
// Public signature: /A|null[0]
|
|
class A : Java2 {
|
|
// CHECK:
|
|
// Mangled name: A#<init>(){}
|
|
// Public signature: /A.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: A#bar(){}kotlin.Number?
|
|
// Public signature: /A.bar|-1679062975122643439[0]
|
|
// Public signature debug description: bar(){}kotlin.Number?
|
|
/* fake */ override fun bar(): Number?
|
|
|
|
// CHECK:
|
|
// Mangled name: A#foo(kotlin.Any?){}
|
|
// Public signature: /A.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
/* fake */ override fun foo(t: Any?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: A#foo(kotlin.Number?){}
|
|
// Public signature: /A.foo|2831167016207060641[0]
|
|
// Public signature debug description: foo(kotlin.Number?){}
|
|
/* fake */ override fun foo(t: Number?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: B
|
|
// Public signature: /B|null[0]
|
|
abstract class B : KotlinClass<Int>, Java3 {
|
|
// CHECK:
|
|
// Mangled name: B#<init>(){}
|
|
// Public signature: /B.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: B#bar(){}kotlin.Int?
|
|
// Public signature: /B.bar|793910862689138186[0]
|
|
// Public signature debug description: bar(){}kotlin.Int?
|
|
/* fake */ override fun bar(): Int?
|
|
|
|
// CHECK:
|
|
// Mangled name: B#foo(kotlin.Any?){}
|
|
// Public signature: /B.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
abstract /* fake */ override fun foo(t: Any?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: B#foo(kotlin.Int?){}
|
|
// Public signature: /B.foo|-4109638554625433529[0]
|
|
// Public signature debug description: foo(kotlin.Int?){}
|
|
/* fake */ override fun foo(t: Int?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: C
|
|
// Public signature: /C|null[0]
|
|
class C : KotlinClass<Int>, Java3 {
|
|
// CHECK:
|
|
// Mangled name: C#<init>(){}
|
|
// Public signature: /C.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: C#bar(){}kotlin.Int?
|
|
// Public signature: /C.bar|793910862689138186[0]
|
|
// Public signature debug description: bar(){}kotlin.Int?
|
|
/* fake */ override fun bar(): Int?
|
|
|
|
// CHECK:
|
|
// Mangled name: C#foo(kotlin.Int?){}
|
|
// Public signature: /C.foo|-4109638554625433529[0]
|
|
// Public signature debug description: foo(kotlin.Int?){}
|
|
/* fake */ override fun foo(t: Int?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: C#foo(kotlin.Any?){}
|
|
// Public signature: /C.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
override fun foo(t: Any?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: D
|
|
// Public signature: /D|null[0]
|
|
abstract class D : Java4<Any>, Java3 {
|
|
// CHECK:
|
|
// Mangled name: D#<init>(){}
|
|
// Public signature: /D.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: D#bar(){}kotlin.Number?
|
|
// Public signature: /D.bar|-1679062975122643439[0]
|
|
// Public signature debug description: bar(){}kotlin.Number?
|
|
/* fake */ override fun bar(): Number?
|
|
|
|
// CHECK:
|
|
// Mangled name: D#foo(kotlin.Number?){}
|
|
// Public signature: /D.foo|2831167016207060641[0]
|
|
// Public signature debug description: foo(kotlin.Number?){}
|
|
/* fake */ override fun foo(t: Number?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: D#foo(kotlin.Any?){}
|
|
// Public signature: /D.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
/* fake */ override fun foo(t: Any?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: E
|
|
// Public signature: /E|null[0]
|
|
class E : Java4<Any>, Java3 {
|
|
// CHECK:
|
|
// Mangled name: E#<init>(){}
|
|
// Public signature: /E.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: E#bar(){}kotlin.Number?
|
|
// Public signature: /E.bar|-1679062975122643439[0]
|
|
// Public signature debug description: bar(){}kotlin.Number?
|
|
/* fake */ override fun bar(): Number?
|
|
|
|
// CHECK:
|
|
// Mangled name: E#foo(kotlin.Number?){}
|
|
// Public signature: /E.foo|2831167016207060641[0]
|
|
// Public signature debug description: foo(kotlin.Number?){}
|
|
/* fake */ override fun foo(t: Number?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: E#foo(kotlin.Any?){}
|
|
// Public signature: /E.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
override fun foo(t: Any?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: F
|
|
// Public signature: /F|null[0]
|
|
abstract class F : Java1<Int>, Java5 {
|
|
// CHECK:
|
|
// Mangled name: F#<init>(){}
|
|
// Public signature: /F.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: F#bar(){}kotlin.Int?
|
|
// Public signature: /F.bar|793910862689138186[0]
|
|
// Public signature debug description: bar(){}kotlin.Int?
|
|
/* fake */ override fun bar(): Int?
|
|
|
|
// CHECK:
|
|
// Mangled name: F#foo(kotlin.Any){}
|
|
// Public signature: /F.foo|-3585887913961670341[0]
|
|
// Public signature debug description: foo(kotlin.Any){}
|
|
abstract /* fake */ override fun foo(t: Any): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: F#foo(kotlin.Int?){}
|
|
// Public signature: /F.foo|-4109638554625433529[0]
|
|
// Public signature debug description: foo(kotlin.Int?){}
|
|
/* fake */ override fun foo(t: Int?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: G
|
|
// Public signature: /G|null[0]
|
|
class G : Java1<Int>, Java5 {
|
|
// CHECK:
|
|
// Mangled name: G#<init>(){}
|
|
// Public signature: /G.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: G#bar(){}kotlin.Int?
|
|
// Public signature: /G.bar|793910862689138186[0]
|
|
// Public signature debug description: bar(){}kotlin.Int?
|
|
/* fake */ override fun bar(): Int?
|
|
|
|
// CHECK:
|
|
// Mangled name: G#foo(kotlin.Int?){}
|
|
// Public signature: /G.foo|-4109638554625433529[0]
|
|
// Public signature debug description: foo(kotlin.Int?){}
|
|
/* fake */ override fun foo(t: Int?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: G#foo(kotlin.Any){}
|
|
// Public signature: /G.foo|-3585887913961670341[0]
|
|
// Public signature debug description: foo(kotlin.Any){}
|
|
override fun foo(t: Any): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: H
|
|
// Public signature: /H|null[0]
|
|
class H : Java2, KotlinInterface<Any> {
|
|
// CHECK:
|
|
// Mangled name: H#<init>(){}
|
|
// Public signature: /H.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: H#bar(){}kotlin.Number?
|
|
// Public signature: /H.bar|-1679062975122643439[0]
|
|
// Public signature debug description: bar(){}kotlin.Number?
|
|
/* fake */ override fun bar(): Number?
|
|
|
|
// CHECK:
|
|
// Mangled name: H#foo(kotlin.Any?){}
|
|
// Public signature: /H.foo|-6211124056249407422[0]
|
|
// Public signature debug description: foo(kotlin.Any?){}
|
|
/* fake */ override fun foo(t: Any?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: H#foo(kotlin.Number?){}
|
|
// Public signature: /H.foo|2831167016207060641[0]
|
|
// Public signature debug description: foo(kotlin.Number?){}
|
|
/* fake */ override fun foo(t: Number?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: I
|
|
// Public signature: /I|null[0]
|
|
class I : Java2, KotlinInterface<Any> {
|
|
// CHECK:
|
|
// Mangled name: I#<init>(){}
|
|
// Public signature: /I.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: I#bar(){}kotlin.Number?
|
|
// Public signature: /I.bar|-1679062975122643439[0]
|
|
// Public signature debug description: bar(){}kotlin.Number?
|
|
/* fake */ override fun bar(): Number?
|
|
|
|
// CHECK:
|
|
// Mangled name: I#foo(kotlin.Number?){}
|
|
// Public signature: /I.foo|2831167016207060641[0]
|
|
// Public signature debug description: foo(kotlin.Number?){}
|
|
/* fake */ override fun foo(t: Number?): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: I#foo(kotlin.Any){}
|
|
// Public signature: /I.foo|-3585887913961670341[0]
|
|
// Public signature debug description: foo(kotlin.Any){}
|
|
override fun foo(t: Any): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinClass
|
|
// Public signature: /KotlinClass|null[0]
|
|
open class KotlinClass<T> : Java1<T> where T : Number, T : Comparable<T> {
|
|
// CHECK:
|
|
// Mangled name: KotlinClass#<init>(){}
|
|
// Public signature: /KotlinClass.<init>|-5645683436151566731[0]
|
|
// Public signature debug description: <init>(){}
|
|
constructor() /* primary */
|
|
|
|
// CHECK JVM_IR:
|
|
// Mangled name: KotlinClass#bar(){}1:0?
|
|
// Public signature: /KotlinClass.bar|-1411410744407944436[0]
|
|
// Public signature debug description: bar(){}1:0?
|
|
/* fake */ override fun bar(): T?
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinClass#foo(1:0?){}
|
|
// Public signature: /KotlinClass.foo|-131141195414545503[0]
|
|
// Public signature debug description: foo(1:0?){}
|
|
/* fake */ override fun foo(t: T?): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface
|
|
// Public signature: /KotlinInterface|null[0]
|
|
interface KotlinInterface<T : Any> {
|
|
// CHECK JVM_IR:
|
|
// Mangled name: KotlinInterface#bar(){}1:0?
|
|
// Public signature: /KotlinInterface.bar|-1411410744407944436[0]
|
|
// Public signature debug description: bar(){}1:0?
|
|
abstract fun bar(): T?
|
|
|
|
// CHECK:
|
|
// Mangled name: KotlinInterface#foo(1:0){}
|
|
// Public signature: /KotlinInterface.foo|-701456291278879981[0]
|
|
// Public signature debug description: foo(1:0){}
|
|
abstract fun foo(t: T): Unit
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: #test(A;B;C;D;E;F;H;I){}
|
|
// Public signature: /test|-8914767252028701820[0]
|
|
// Public signature debug description: test(A;B;C;D;E;F;H;I){}
|
|
fun test(a: A, b: B, c: C, d: D, e: E, f: F, h: H, i: I): Unit
|