Files
kotlin-fork/compiler/testData/codegen/boxInline/enclosingInfo/anonymousInLambda.kt
T
2019-09-06 09:19:57 +03:00

28 lines
588 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
// TARGET_BACKEND: JVM
// NO_CHECK_LAMBDA_INLINING
// WITH_REFLECT
// 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()
}