Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt47082.sig.kt.txt
T
Sergej Jaskiewicz 6e8283a6fe [IR] Dump IdSignatures and mangled names in irText tests
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
2023-05-15 18:20:45 +00:00

42 lines
1.1 KiB
Kotlin
Vendored

// CHECK:
// Mangled name: Base
// Public signature: /Base|null[0]
interface Base<in E : Any?> {
}
// CHECK:
// Mangled name: Derived
// Public signature: /Derived|null[0]
interface Derived<in E : Any?> : Base<E> {
}
// CHECK:
// Mangled name: Receiver
// Public signature: /Receiver|null[0]
interface Receiver<out E : Any?> {
}
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String
// Public signature: /box|-9347091776561469[0]
fun box(): String
// CHECK JVM_IR:
// Mangled name: #foo(Receiver<0:0>){0§<kotlin.Any?>}0:0
// Public signature: /foo|1374936692204158291[0]
fun <R : Any?> foo(r: Receiver<R>): R
// CHECK JVM_IR:
// Mangled name: #produce(kotlin.Function1<Derived<0:0>,kotlin.Unit>){0§<kotlin.Any?>}0:0
// Public signature: /produce|-8861632226015581377[0]
fun <E : Any?> produce(block: @ExtensionFunctionType Function1<Derived<E>, Unit>): E
// CHECK JVM_IR:
// Mangled name: #toChannel@Receiver<0:0>(0:1){0§<kotlin.Any?>;1§<Base<0:0>>}0:1
// Public signature: /toChannel|5706628675310331058[0]
fun <E : Any?, C : Base<E>> Receiver<E>.toChannel(destination: C): C