24aee1cce3
All tests on anonymous objects should use the NO_CHECK_LAMBDA_INLINING directive, since the test framework can't tell an anonymous object from a lambda and checking that anonymous objects are "inlined" makes no sense.
24 lines
327 B
Kotlin
Vendored
24 lines
327 B
Kotlin
Vendored
// NO_CHECK_LAMBDA_INLINING
|
|
// FILE: 1.kt
|
|
|
|
package test
|
|
|
|
inline fun <T> myRun(block: () -> T) = block()
|
|
|
|
// FILE: 2.kt
|
|
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
val x = myRun {
|
|
fun foo() = "OK"
|
|
|
|
val o = object {
|
|
val f = ::foo
|
|
fun bar() = f()
|
|
}
|
|
o
|
|
}
|
|
return x.bar()
|
|
}
|