Deprecate 'kotlin.throws' in favor of 'kotlin.jvm.Throws'

This commit is contained in:
Denis Zharkov
2015-09-10 16:42:22 +03:00
parent 7036b36a94
commit df97496a16
6 changed files with 34 additions and 6 deletions
@@ -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>)
+2 -1
View File
@@ -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.