JVM_IR KT-45581 generate H_INVOKEINTERFACE for interface method handles
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// FILE: interfaceMemberRef.kt
|
||||
interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
class C(val v: String) : IFoo {
|
||||
override fun foo(): String = v
|
||||
}
|
||||
|
||||
fun box() = Sam(IFoo::foo).get(C("OK"))
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
String get(IFoo c);
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// FULL_JDK
|
||||
// IGNORE_DEXING
|
||||
// ^ D8 fails with AssertionError, possible reason: only Kotlin output files are passed to D8
|
||||
// FILE: kt45581.kt
|
||||
|
||||
fun box(): String = J.bar(emptySet<String>()::contains)
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class J {
|
||||
public static String bar(Predicate<String> predicate) {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user