Add quickfix for adding CancellableException to @Throws suspend fun

This commit is contained in:
Svyatoslav Scherbina
2020-05-25 15:04:42 +03:00
parent 290a824107
commit b7a08494ae
14 changed files with 176 additions and 1 deletions
@@ -0,0 +1,3 @@
package kotlin.coroutines.cancellation
public open class CancellationException() : IllegalStateException()
@@ -0,0 +1,15 @@
package kotlin
import kotlin.reflect.KClass
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.SOURCE)
public annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
public open class Exception : Throwable()
public open class RuntimeException : Exception()
public open class IllegalStateException : RuntimeException()
public open class Error : Throwable()
@@ -0,0 +1,4 @@
// "Add 'CancellationException::class'" "true"
<caret>@Throws(Error::class)
suspend fun addCE() {}
@@ -0,0 +1,6 @@
import kotlin.coroutines.cancellation.CancellationException
// "Add 'CancellationException::class'" "true"
@Throws(Error::class, CancellationException::class)
suspend fun addCE() {}