Merge boxWithStdlib testData into box, delete BoxWithStdlib test
This commit is contained in:
committed by
Alexander Udalov
parent
22bfc9786a
commit
06a67e6602
@@ -0,0 +1,25 @@
|
||||
// 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()
|
||||
}
|
||||
Reference in New Issue
Block a user