Files
kotlin-fork/compiler/testData/codegen/box/sam/kt17091_2.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

38 lines
733 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
// SAM_CONVERSIONS: CLASS
// FILE: Foo.kt
@file:JvmName("testXX")
package test
class A2 {
fun doWork(job: () -> Unit) {
Runnable(job)
}
}
// FILE: kt17091_2.kt
@file:JvmMultifileClass
@file:JvmName("testX")
package test
typealias Z = String
class A {
fun doWork(job: () -> Unit) {
Runnable(job).run()
}
}
fun box(): String {
var result = "fail"
A().doWork { result = "OK" }
if (java.lang.Class.forName("test.testX__Kt17091_2Kt\$sam\$java_lang_Runnable$0") == null) return "fail: can't find sam wrapper"
if (java.lang.Class.forName("test.A2\$sam\$java_lang_Runnable$0") == null) return "fail 2: can't find sam wrapper"
return result
}