Files
kotlin-fork/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.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

66 lines
2.0 KiB
Kotlin
Vendored

// CHECK:
// Mangled name: Test
// Public signature: /Test|null[0]
class Test<TT : Any?> : IBase<TT> {
// CHECK:
// Mangled name: Test#<init>(IBase<1:0>){}
// Public signature: /Test.<init>|-3017997426280513504[0]
constructor(impl: IBase<TT>) /* primary */
// CHECK:
// Mangled name: Test.$$delegate_0
// Public signature: /Test.$$delegate_0|-7286425919675154353[0]
private /* final field */ val $$delegate_0: IBase<TT>
// CHECK:
// Mangled name: Test#foo(kotlin.Int){}
// Public signature: /Test.foo|-104159190164110731[0]
override fun foo(x: Int): Unit
// CHECK:
// Mangled name: Test#qux(1:0;0:0){0§<kotlin.Any?>}
// Public signature: /Test.qux|2089843959414439633[0]
override fun <X : Any?> qux(t: TT, x: X): Unit
// CHECK:
// Mangled name: Test{}bar
// Public signature: /Test.bar|-7864284097863469857[0]
override val bar: Int
// CHECK JVM_IR:
// Mangled name: Test#<get-bar>(){}kotlin.Int
// Public signature: /Test.bar.<get-bar>|-7403724005139201014[0]
// CHECK JS_IR NATIVE:
// Mangled name: Test#<get-bar>(){}
// Public signature: /Test.bar.<get-bar>|6880642144337645699[0]
override get(): Int
}
// CHECK:
// Mangled name: IBase
// Public signature: /IBase|null[0]
interface IBase<T : Any?> {
// CHECK:
// Mangled name: IBase#foo(kotlin.Int){}
// Public signature: /IBase.foo|-104159190164110731[0]
abstract fun foo(x: Int): Unit
// CHECK:
// Mangled name: IBase#qux(1:0;0:0){0§<kotlin.Any?>}
// Public signature: /IBase.qux|2089843959414439633[0]
abstract fun <X : Any?> qux(t: T, x: X): Unit
// CHECK:
// Mangled name: IBase{}bar
// Public signature: /IBase.bar|-7864284097863469857[0]
abstract val bar: Int
// CHECK JVM_IR:
// Mangled name: IBase#<get-bar>(){}kotlin.Int
// Public signature: /IBase.bar.<get-bar>|-7403724005139201014[0]
// CHECK JS_IR NATIVE:
// Mangled name: IBase#<get-bar>(){}
// Public signature: /IBase.bar.<get-bar>|6880642144337645699[0]
abstract get
}