Files
kotlin-fork/compiler/testData/codegen/box/sam/kt17091_2.kt
T
Mikhail Glukhikh 89e5e10657 [FIR2IR] Drop effectively unused FirMetadataSource.File.descriptors
NB: only FileClassLowering uses this property to check
whether facade is required, and IR-based check is enough in this lowering
2020-06-08 16:19:37 +03:00

37 lines
708 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_RUNTIME
// 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
}