Files
kotlin-fork/compiler/testData/codegen/box/sam/kt22906.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

27 lines
576 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
// SAM_CONVERSIONS: CLASS
// FILE: kt22906_1.kt
package test
class C {
fun startTemplate(): String {
val y = object {
fun foo(): String {
val job = { "OK" }
return java.util.concurrent.Callable(job).call()
}
}
return y.foo()
}
}
// FILE: kt22906_2.kt
import test.*
fun box(): String {
if (java.lang.Class.forName("test.C\$sam\$java_util_concurrent_Callable\$0") == null) return "fail: can't find sam wrapper"
return C().startTemplate()
}