https://kotlinlang.org logo
Title
u

ursus

03/07/2019, 5:36 PM
is
@Throws
annotation worth anything in practise?
d

Dias

03/07/2019, 5:38 PM
for interop with java, if you want to signify checked exception when calling code from java
u

ursus

03/07/2019, 5:39 PM
oh, didnt know that, thanks
j

jw

03/07/2019, 5:44 PM
it's required for interface methods backed by java.lang.reflect.Proxy to throw checked exceptions even if the consumer is in Kotlin
k

kevinmost

03/07/2019, 6:30 PM
If you write a Kotlin interface that a checked exception to be thrown by one of its abstract methods, and then a Java consumer implements that interface, they can't throw the exception unless you add
@Throws
(because their override of that method can't add
throws
to its header)