cd9209a7ee
Most of these tests check the specific structure of lambdas when they are generated as classes, and they start to fail once invokedynamic lambdas are enabled by default.
28 lines
452 B
Kotlin
Vendored
28 lines
452 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// LAMBDAS: CLASS
|
|
// WITH_REFLECT
|
|
|
|
import java.util.HashMap
|
|
|
|
interface R {
|
|
fun result(): String
|
|
}
|
|
|
|
val a by lazy {
|
|
with(HashMap<String, R>()) {
|
|
put("result", object : R {
|
|
override fun result(): String = "OK"
|
|
})
|
|
this
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val r = a["result"]!!
|
|
|
|
// Check that reflection won't fail
|
|
r.javaClass.getEnclosingMethod().toString()
|
|
|
|
return r.result()
|
|
}
|