Files
kotlin-fork/compiler/testData/codegen/boxInline/enclosingInfo/anonymousInLambda.kt
T
2016-02-27 15:40:06 +03:00

24 lines
457 B
Kotlin
Vendored

// FILE: 1.kt
package test
inline fun <R> call(s: () -> R) = s()
// FILE: 2.kt
import test.*
fun box(): String {
val res = call {
{ "OK" }
}
var enclosingMethod = res.javaClass.enclosingMethod
if (enclosingMethod?.name != "box") return "fail 1: ${enclosingMethod?.name}"
var enclosingClass = res.javaClass.enclosingClass
if (enclosingClass?.name != "_2Kt") return "fail 2: ${enclosingClass?.name}"
return res()
}