6e8283a6fe
The reason #1 for this feature is that we want to test IdSignatures generated for declarations. Currently, there is no (easy) way to ensure that a change in the signature building logic doesn't cause any breaking changes wrt klibs. Now, most IdSignatures include hashed mangled names in them, so even if we catch a regression where the included hash changes, there would be no way of knowing immediately what caused it, unless we'd also have mangled names in the expectations. The reason #2 is to test the manglers themselves. Currently, there are no tests for them. They heavily duplicate each other, this is already causing issues (see KT-57427) that would be very hard to catch without these tests. ^KT-58238 Fixed
86 lines
2.4 KiB
Kotlin
Vendored
86 lines
2.4 KiB
Kotlin
Vendored
// CHECK:
|
|
// Mangled name: A1
|
|
// Public signature: /A1|null[0]
|
|
open annotation class A1 : Annotation {
|
|
// CHECK:
|
|
// Mangled name: A1{}xs
|
|
// Public signature: /A1.xs|1063330853857063704[0]
|
|
val xs: IntArray
|
|
// CHECK JVM_IR:
|
|
// Mangled name: A1#<get-xs>(){}kotlin.IntArray
|
|
// Public signature: /A1.xs.<get-xs>|5887559004820637749[0]
|
|
// CHECK JS_IR NATIVE:
|
|
// Mangled name: A1#<get-xs>(){}
|
|
// Public signature: /A1.xs.<get-xs>|-6958094100501701183[0]
|
|
get
|
|
|
|
// CHECK:
|
|
// Mangled name: A1#<init>(kotlin.IntArray...){}
|
|
// Public signature: /A1.<init>|3304157197881351514[0]
|
|
constructor(vararg xs: Int) /* primary */
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: A2
|
|
// Public signature: /A2|null[0]
|
|
open annotation class A2 : Annotation {
|
|
// CHECK:
|
|
// Mangled name: A2{}xs
|
|
// Public signature: /A2.xs|1063330853857063704[0]
|
|
val xs: Array<out String>
|
|
// CHECK JVM_IR:
|
|
// Mangled name: A2#<get-xs>(){}kotlin.Array<out|kotlin.String>
|
|
// Public signature: /A2.xs.<get-xs>|9188548163055185324[0]
|
|
// CHECK JS_IR NATIVE:
|
|
// Mangled name: A2#<get-xs>(){}
|
|
// Public signature: /A2.xs.<get-xs>|-6958094100501701183[0]
|
|
get
|
|
|
|
// CHECK:
|
|
// Mangled name: A2#<init>(kotlin.Array<out|kotlin.String>...){}
|
|
// Public signature: /A2.<init>|-6780234697714860085[0]
|
|
constructor(vararg xs: String) /* primary */
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: AA
|
|
// Public signature: /AA|null[0]
|
|
open annotation class AA : Annotation {
|
|
// CHECK:
|
|
// Mangled name: AA{}xs
|
|
// Public signature: /AA.xs|1063330853857063704[0]
|
|
val xs: Array<out A1>
|
|
// CHECK JVM_IR:
|
|
// Mangled name: AA#<get-xs>(){}kotlin.Array<out|A1>
|
|
// Public signature: /AA.xs.<get-xs>|-3667422235339963828[0]
|
|
// CHECK JS_IR NATIVE:
|
|
// Mangled name: AA#<get-xs>(){}
|
|
// Public signature: /AA.xs.<get-xs>|-6958094100501701183[0]
|
|
get
|
|
|
|
// CHECK:
|
|
// Mangled name: AA#<init>(kotlin.Array<out|A1>...){}
|
|
// Public signature: /AA.<init>|-3149474316715311617[0]
|
|
constructor(vararg xs: A1) /* primary */
|
|
|
|
}
|
|
|
|
// CHECK:
|
|
// Mangled name: #test1(){}
|
|
// Public signature: /test1|4297044443957252634[0]
|
|
@A1(xs = [1, 2, 3])
|
|
@A2(xs = ["a", "b", "c"])
|
|
@AA(xs = [A1(xs = [4]), A1(xs = [5]), A1(xs = [6])])
|
|
fun test1(): Unit
|
|
|
|
// CHECK:
|
|
// Mangled name: #test2(){}
|
|
// Public signature: /test2|4279114864133353152[0]
|
|
@A1(xs = [])
|
|
@A2(xs = [])
|
|
@AA(xs = [])
|
|
fun test2(): Unit
|
|
|