Psi2Ir: Fix SAM conversion with new inference

This commit is contained in:
Steven Schäfer
2020-08-21 11:21:51 +02:00
committed by Dmitry Petrov
parent 75891e860b
commit 44ffb1fb3e
8 changed files with 49 additions and 16 deletions
@@ -1,6 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// FILE: example/Hello.java
package example;
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM
// FILE: A.java
public class A<T> {
public interface I<T> {
String apply(T x);
}
public String call(I<T> block) { return block.apply(null); }
}
// FILE: test.kt
fun f(x: Any): String {
if (x is A<*>) {
return x.call { y: Any? -> "OK" }
}
return "Fail"
}
fun box(): String {
return f(A<Int>())
}