Psi2Ir: Fix SAM conversion with new inference
This commit is contained in:
committed by
Dmitry Petrov
parent
75891e860b
commit
44ffb1fb3e
-2
@@ -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>())
|
||||
}
|
||||
Reference in New Issue
Block a user