Skip to content

Commit 277b1cb

Browse files
committed
Annotate findAnnotation and IllegalPropertyDelegateAccessException with SinceKotlin(1.1)
(cherry picked from commit 5987e8a)
1 parent 1ceb7f5 commit 277b1cb

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
@@ -21,6 +21,7 @@ package kotlin.reflect
2121
* Returns an annotation of the given type on this element.
2222
*/
2323
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
24-
@Suppress("UNCHECKED_CAST")
24+
@SinceKotlin("1.1")
2525
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
26+
@Suppress("UNCHECKED_CAST")
2627
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)