Files
kotlin-fork/compiler/testData/codegen/box/builtinStubMethods/substitutedIterable.kt
T
Mark Punzalan 5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00

31 lines
591 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: Test.java
public class Test {
public static void checkCallFromJava() {
try {
String x = TestKt.foo().iterator().next();
throw new AssertionError("E should have been thrown");
} catch (E e) { }
}
}
// FILE: test.kt
interface MyIterable<T> : Iterable<T>
class E : RuntimeException()
fun foo(): MyIterable<String> = throw E()
fun box(): String {
try {
foo().iterator().next()
return "Fail: E should have been thrown"
} catch (e: E) {}
Test.checkCallFromJava()
return "OK"
}