Skip to content

Commit 5987e8a

Browse files
committed
Annotate findAnnotation and IllegalPropertyDelegateAccessException with SinceKotlin(1.1)
1 parent 845d652 commit 5987e8a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

core/reflection.jvm/src/kotlin/reflect/KAnnotatedElements.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package kotlin.reflect
2323
*/
2424
@kotlin.internal.LowPriorityInOverloadResolution
2525
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
26-
@Suppress("UNCHECKED_CAST")
26+
@SinceKotlin("1.1")
2727
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
28+
@Suppress("UNCHECKED_CAST")
2829
annotations.firstOrNull { it is T } as T?

core/reflection.jvm/src/kotlin/reflect/full/KAnnotatedElements.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import kotlin.reflect.*
2222
/**
2323
* Returns an annotation of the given type on this element.
2424
*/
25-
@Suppress("UNCHECKED_CAST")
25+
@SinceKotlin("1.1")
2626
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
27+
@Suppress("UNCHECKED_CAST")
2728
annotations.firstOrNull { it is T } as T?

core/reflection.jvm/src/kotlin/reflect/full/exceptions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class IllegalCallableAccessException(cause: IllegalAccessException) : kotlin.ref
3838
* @see [kotlin.reflect.KProperty2.getDelegate]
3939
* @see [kotlin.reflect.jvm.isAccessible]
4040
*/
41+
@SinceKotlin("1.1")
4142
class IllegalPropertyDelegateAccessException(cause: IllegalAccessException) : Exception(
4243
"Cannot obtain the delegate of a non-accessible property. Use \"isAccessible = true\" to make the property accessible",
4344
cause

0 commit comments

Comments
 (0)