Do not generate Throws attribute for delegated members from Kotlin interfaces

#KT-31763 Fixed
 #KT-35834
This commit is contained in:
Alexander Udalov
2020-01-08 17:59:37 +01:00
parent 79d7335b8d
commit 621936e951
19 changed files with 294 additions and 18 deletions
@@ -0,0 +1,28 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: A.kt
import java.io.IOException
interface A {
@Throws(IOException::class)
@Anno
fun foo()
}
annotation class Anno
// 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 throws: ${method.exceptionTypes.toList()}"
if (method.declaredAnnotations.size != 1)
return "Fail annotations: ${method.declaredAnnotations.toList()}"
return "OK"
}