Deprecate 'kotlin.throws' in favor of 'kotlin.jvm.Throws'
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package kotlin.jvm
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Instructs the Kotlin compiler to generate overloads for this function that substitute default parameter values.
|
||||
*
|
||||
@@ -64,4 +66,25 @@ public annotation class JvmMultifileClass
|
||||
@Target(AnnotationTarget.FIELD)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class publicField
|
||||
public annotation class publicField
|
||||
|
||||
/**
|
||||
* This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* throws(IOException::class)
|
||||
* fun readFile(name: String): String {...}
|
||||
* ```
|
||||
*
|
||||
* will be translated to
|
||||
*
|
||||
* ```
|
||||
* String readFile(String name) throws IOException {...}
|
||||
* ```
|
||||
*
|
||||
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
|
||||
*/
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
|
||||
|
||||
@@ -23,7 +23,8 @@ import kotlin.reflect.KClass
|
||||
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
|
||||
*/
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
|
||||
@Deprecated("Use 'kotlin.jvm.Throws' instead", ReplaceWith("kotlin.jvm.Throws"))
|
||||
public annotation class throws(public vararg val exceptionClasses: KClass<out Throwable>)
|
||||
|
||||
/**
|
||||
* Returns the runtime Java class of this object.
|
||||
|
||||
Reference in New Issue
Block a user