Files
kotlin-fork/compiler/testData/codegen/box/throws/delegationAndThrows.kt
T
2020-01-16 12:43:09 +01:00

25 lines
492 B
Kotlin
Vendored

// !LANGUAGE: +DoNotGenerateThrowsForDelegatedKotlinMembers
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// FILE: A.kt
import java.io.IOException
interface A {
@Throws(IOException::class)
fun foo()
}
// 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"
}