42f75b3247
Otherwise, the cached instances cannot be reused for different wrapped types. Also, if the wrapped type is regenerated during inlining, the inliner would produce a call to a nonexistent constructor that takes the regenerated type as an argument.
16 lines
260 B
Kotlin
Vendored
16 lines
260 B
Kotlin
Vendored
// FILE: 1.kt
|
|
package test
|
|
|
|
inline fun f(crossinline g: () -> Unit) = Runnable(object : () -> Unit {
|
|
override fun invoke() = g()
|
|
})
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
var result = "FAIL"
|
|
f { result = "OK" }.run()
|
|
return result
|
|
}
|