Add "Remove annotation" quickfix for @Throws override mismatch

This commit is contained in:
Svyatoslav Scherbina
2020-05-25 18:26:33 +03:00
parent 6461c1b4f1
commit 46caf27e70
5 changed files with 39 additions and 0 deletions
@@ -0,0 +1,7 @@
package kotlin
import kotlin.reflect.KClass
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.SOURCE)
public annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
@@ -0,0 +1,13 @@
// "Remove annotation" "true"
class MyException : Throwable()
interface Base {
@Throws(Throwable::class)
fun foo()
}
class Derived : Base {
<caret>@Throws(MyException::class)
override fun foo() {}
}
@@ -0,0 +1,12 @@
// "Remove annotation" "true"
class MyException : Throwable()
interface Base {
@Throws(Throwable::class)
fun foo()
}
class Derived : Base {
override fun foo() {}
}