mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-07 08:31:28 +00:00
26 lines
390 B
Kotlin
Vendored
26 lines
390 B
Kotlin
Vendored
// NO_CHECK_LAMBDA_INLINING
|
|
// FILE: 1.kt
|
|
package test
|
|
|
|
interface Call {
|
|
fun run(): String
|
|
}
|
|
|
|
inline fun test(s: () -> Call = {
|
|
object : Call {
|
|
override fun run() = "OK"
|
|
} as Call
|
|
}) = s()
|
|
|
|
val same = test()
|
|
|
|
// FILE: 2.kt
|
|
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
val inlined = test()
|
|
if (same.run() != "OK") return "fail 1: ${same.run()}"
|
|
return inlined.run()
|
|
}
|