Files
kotlin-fork/compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt
T
Mads Ager 261482904c [FIR] Give external package fragments different module descriptors.
The inliner uses module descriptors to figure out if it needs to
regenerate objects.

We should avoid the use of descriptors in the inliner, but this
works as a first quick fix.
2021-11-25 13:20:31 +03:00

25 lines
555 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
// MODULE: lib
// FILE: A.kt
package test
inline fun test(s: () -> () -> () -> String = { val z = "Outer"; { { "OK" } } }) =
s()
val same = test()
// MODULE: main(lib)
// FILE: B.kt
import test.*
fun box(): String {
val inlined = test()
if (same::class.java == inlined::class.java) return "fail 1 : ${same::class.java} == ${inlined::class.java}"
if (same()::class.java == inlined()::class.java) return "fail 2 : ${same()::class.java} == ${inlined()::class.java}"
return inlined()()
}