mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
Do not generate Throws attribute for delegated members from Kotlin interfaces
#KT-31763 Fixed #KT-35834
This commit is contained in:
21
compiler/testData/codegen/boxAgainstJava/throws/delegationAndThrows.kt
vendored
Normal file
21
compiler/testData/codegen/boxAgainstJava/throws/delegationAndThrows.kt
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// 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"
|
||||
}
|
||||
Reference in New Issue
Block a user