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

75 lines
2.4 KiB
Kotlin
Vendored

// CHECK:
// Mangled name: L
// Public signature: /L|null[0]
open class L<LL : Any?> {
// CHECK:
// Mangled name: L{}ll
// Public signature: /L.ll|-6205844342928411776[0]
val ll: LL
// CHECK JVM_IR:
// Mangled name: L#<get-ll>(){}1:0
// Public signature: /L.ll.<get-ll>|3292228176841932804[0]
// CHECK JS_IR NATIVE:
// Mangled name: L#<get-ll>(){}
// Public signature: /L.ll.<get-ll>|-3038615916069329440[0]
get
// CHECK:
// Mangled name: L#<init>(1:0){}
// Public signature: /L.<init>|-8731461708390519279[0]
constructor(ll: LL) /* primary */
}
// CHECK:
// Mangled name: Rec
// Public signature: /Rec|null[0]
class Rec<T : Any?> {
// CHECK:
// Mangled name: Rec{}rt
// Public signature: /Rec.rt|-2445570895924930609[0]
val rt: T
// CHECK JVM_IR:
// Mangled name: Rec#<get-rt>(){}1:0
// Public signature: /Rec.rt.<get-rt>|4833941673195700440[0]
// CHECK JS_IR NATIVE:
// Mangled name: Rec#<get-rt>(){}
// Public signature: /Rec.rt.<get-rt>|2938093614484966158[0]
get
// CHECK:
// Mangled name: Rec#<init>(1:0){}
// Public signature: /Rec.<init>|-8731461708390519279[0]
constructor(rt: T) /* primary */
}
// CHECK JVM_IR:
// Mangled name: #fn@Rec<0:0>(){0§<kotlin.Any?>}L<0:0>
// Public signature: /fn|458419256100465624[0]
// CHECK JS_IR NATIVE:
// Mangled name: #fn@Rec<0:0>(){0§<kotlin.Any?>}
// Public signature: /fn|-2196095281162048366[0]
fun <FT : Any?> Rec<FT>.fn(): L<FT>
// CHECK JVM_IR:
// Mangled name: #foo2(0:0;0:1;kotlin.Function2<0:0,0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}0:2
// Public signature: /foo2|-6186734139379933811[0]
// CHECK JS_IR NATIVE:
// Mangled name: #foo2(0:0;0:1;kotlin.Function2<0:0,0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}
// Public signature: /foo2|6240807387010061447[0]
fun <T1 : Any?, T2 : Any?, R : Any?> foo2(t1: T1, t2: T2, bb: Function2<T1, T2, R>): R
// CHECK:
// Mangled name: @Rec<0:0>{0§<kotlin.Any?>}p
// Public signature: /p|1337333823224750046[0]
val <PT : Any?> Rec<PT>.p: L<PT>
// CHECK JVM_IR:
// Mangled name: #<get-p>@Rec<0:0>(){0§<kotlin.Any?>}L<0:0>
// Public signature: /p.<get-p>|-439714386562020387[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-p>@Rec<0:0>(){0§<kotlin.Any?>}
// Public signature: /p.<get-p>|-3789410829860408186[0]
get(): L<PT>