Files
kotlin-fork/compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/adaptedFunRefWithCoercionToUnit.kt
T
2021-02-19 12:04:30 +03:00

21 lines
315 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
// FILE: adaptedFunRefWithCoercionToUnit.kt
var ok = "Failed"
fun test(s: String): Int {
ok = s
return 42
}
fun box(): String {
Sam(::test).foo("OK")
return ok
}
// FILE: Sam.java
public interface Sam {
void foo(String s);
}