Files
kotlin-fork/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.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

65 lines
2.2 KiB
Kotlin
Vendored

package test
// CHECK:
// Mangled name: test.Foo
// Public signature: test/Foo|null[0]
class Foo<T : Any?> {
// CHECK:
// Mangled name: test.Foo.Inner
// Public signature: test/Foo.Inner|null[0]
inner class Inner<P : Any?> {
// CHECK:
// Mangled name: test.Foo.Inner{}a
// Public signature: test/Foo.Inner.a|-1200697420457237799[0]
val a: T
// CHECK JVM_IR:
// Mangled name: test.Foo.Inner#<get-a>(){}2:0
// Public signature: test/Foo.Inner.a.<get-a>|6634660852321063487[0]
// CHECK JS_IR NATIVE:
// Mangled name: test.Foo.Inner#<get-a>(){}
// Public signature: test/Foo.Inner.a.<get-a>|6785176174175479410[0]
get
// CHECK:
// Mangled name: test.Foo.Inner{}b
// Public signature: test/Foo.Inner.b|772347207915745207[0]
val b: P
// CHECK JVM_IR:
// Mangled name: test.Foo.Inner#<get-b>(){}1:0
// Public signature: test/Foo.Inner.b.<get-b>|-8930371436958509614[0]
// CHECK JS_IR NATIVE:
// Mangled name: test.Foo.Inner#<get-b>(){}
// Public signature: test/Foo.Inner.b.<get-b>|812004636995167743[0]
get
// CHECK:
// Mangled name: test.Foo.Inner#<init>(2:0;1:0){}
// Public signature: test/Foo.Inner.<init>|-2512702059187080850[0]
constructor(a: T, b: P) /* primary */
}
// CHECK:
// Mangled name: test.Foo#<init>(){}
// Public signature: test/Foo.<init>|-5645683436151566731[0]
constructor() /* primary */
}
// CHECK JVM_IR:
// Mangled name: test#box(){}kotlin.String
// Public signature: test/box|-9347091776561469[0]
// CHECK JS_IR NATIVE:
// Mangled name: test#box(){}
// Public signature: test/box|2173511048851971368[0]
fun box(): String
// CHECK JVM_IR:
// Mangled name: test#foo(0:0;0:1;kotlin.Function2<0:0,0:1,test.Foo.Inner<0:1,0:0>>){0§<kotlin.Any?>;1§<kotlin.Any?>}test.Foo.Inner<0:1,0:0>
// Public signature: test/foo|-4791591590952018519[0]
// CHECK JS_IR NATIVE:
// Mangled name: test#foo(0:0;0:1;kotlin.Function2<0:0,0:1,test.Foo.Inner<0:1,0:0>>){0§<kotlin.Any?>;1§<kotlin.Any?>}
// Public signature: test/foo|-2625863985883503743[0]
inline fun <A : Any?, B : Any?> foo(a: A, b: B, x: Function2<A, B, Inner<B, A>>): Inner<B, A>