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

64 lines
1.9 KiB
Kotlin
Vendored

// CHECK:
// Mangled name: {}fsi
// Public signature: /fsi|5902301571547257746[0]
val fsi: Fn<String, Int>
// CHECK JVM_IR:
// Mangled name: #<get-fsi>(){}Fn<kotlin.String,kotlin.Int>
// Public signature: /fsi.<get-fsi>|-2546794996796226350[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-fsi>(){}
// Public signature: /fsi.<get-fsi>|211056100616532240[0]
get
// CHECK:
// Mangled name: {}fis
// Public signature: /fis|4743015834142814854[0]
val fis: Fn<Int, String>
// CHECK JVM_IR:
// Mangled name: #<get-fis>(){}Fn<kotlin.Int,kotlin.String>
// Public signature: /fis.<get-fis>|5252092316637653538[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-fis>(){}
// Public signature: /fis.<get-fis>|-3144498278709673820[0]
get
// CHECK:
// Mangled name: J
// Public signature: /J|null[0]
class J {
// CHECK:
// Mangled name: J#<init>(){}
// Public signature: /J.<init>|-5645683436151566731[0]
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: J#runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}kotlin.Int
// Public signature: /J.runConversion|4347513371052535712[0]
// CHECK JS_IR NATIVE:
// Mangled name: J#runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}
// Public signature: /J.runConversion|-3250437629905581865[0]
fun runConversion(f1: Fn<String, Int>, f2: Fn<Int, String>): Int
}
// CHECK:
// Mangled name: Fn
// Public signature: /Fn|null[0]
fun interface Fn<T : Any?, R : Any?> {
// CHECK JVM_IR:
// Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){}1:1
// Public signature: /Fn.run|6229634511602909233[0]
// CHECK JS_IR NATIVE:
// Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){}
// Public signature: /Fn.run|-3043809751901738692[0]
abstract fun run(s: String, i: Int, t: T): R
}
// CHECK:
// Mangled name: #test(J){}
// Public signature: /test|-8477572416399964095[0]
fun test(j: J): Unit