mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
19 lines
372 B
Kotlin
Vendored
19 lines
372 B
Kotlin
Vendored
// SAM_CONVERSIONS: CLASS
|
|
// FILE: J.java
|
|
|
|
public class J {
|
|
public static void g(Runnable r) {
|
|
r.run();
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
fun box(): String {
|
|
var result = "Fail"
|
|
val setter = { result = "OK" }
|
|
1.apply { J.g(setter) }
|
|
return result
|
|
}
|
|
|
|
// 1 INVOKESPECIAL TestKt\$sam\$i\$java_lang_Runnable\$0.<init> \(Lkotlin/jvm/functions/Function0;\)V |