Files
kotlin-fork/compiler/testData/codegen/boxAgainstJava/throws/delegationAndThrows.kt
T
Mark Punzalan 69cd729506 [FIR] Enable BlackBoxAgainstJavaCodegen tests for FIR.
23 out of 156 tests (14.7%) are currently failing.
2020-09-29 10:21:21 +03:00

23 lines
431 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: A.java
import java.io.IOException;
public interface A {
void foo() throws IOException;
}
// FILE: B.kt
class B(a: A) : A by a
fun box(): String {
val method = B::class.java.declaredMethods.single { it.name == B::foo.name }
if (method.exceptionTypes.size != 0)
return "Fail: ${method.exceptionTypes.toList()}"
return "OK"
}