Annotate findAnnotation and IllegalPropertyDelegateAccessException with SinceKotlin(1.1)
This commit is contained in:
@@ -23,6 +23,7 @@ package kotlin.reflect
|
||||
*/
|
||||
@kotlin.internal.LowPriorityInOverloadResolution
|
||||
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@SinceKotlin("1.1")
|
||||
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
annotations.firstOrNull { it is T } as T?
|
||||
|
||||
@@ -22,6 +22,7 @@ import kotlin.reflect.*
|
||||
/**
|
||||
* Returns an annotation of the given type on this element.
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@SinceKotlin("1.1")
|
||||
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
annotations.firstOrNull { it is T } as T?
|
||||
|
||||
@@ -38,6 +38,7 @@ class IllegalCallableAccessException(cause: IllegalAccessException) : kotlin.ref
|
||||
* @see [kotlin.reflect.KProperty2.getDelegate]
|
||||
* @see [kotlin.reflect.jvm.isAccessible]
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
class IllegalPropertyDelegateAccessException(cause: IllegalAccessException) : Exception(
|
||||
"Cannot obtain the delegate of a non-accessible property. Use \"isAccessible = true\" to make the property accessible",
|
||||
cause
|
||||
|
||||
Reference in New Issue
Block a user