Files
kotlin-fork/compiler/testData/codegen/box/compileKotlinAgainstKotlin/copySamOnInline2.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

27 lines
506 B
Kotlin
Vendored

// FULL_JDK
// WITH_STDLIB
// MODULE: lib
// FILE: A.kt
package test
import java.util.concurrent.Callable
inline fun doWork(noinline job: () -> String): Callable<String> {
return Callable(job)
}
// MODULE: main(lib)
// FILE: B.kt
import test.*
fun box(): String {
val anotherModule = doWork { "K" }
if (anotherModule.javaClass.name != "BKt\$inlined\$sam\$i\$java_util_concurrent_Callable\$0") return "class should be regenerated, but ${anotherModule.javaClass.name}"
return "OK"
}