Files
kotlin-fork/compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.kt
T

19 lines
335 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: genericSamSmartcast.kt
fun f(x: Any): String {
if (x is A<*>) {
return x.call { y: Any? -> "OK" }
}
return "Fail"
}
// FILE: A.java
public class A<T> {
public interface I<S> {
String apply(S x);
}
public String call(I<T> block) { return block.apply(null); }
}