Files
kotlin-fork/compiler/testData/codegen/boxInline/anonymousObject/safeCall.kt
T
2018-06-28 12:26:41 +02:00

26 lines
331 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
package test
class W(val value: Any)
inline fun W.safe(crossinline body : Any.() -> Unit) {
{
this.value?.body()
}()
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
W("OK").safe {
result = this as String
}
return result
}