Skip to content

Commit ab44f5c

Browse files
committed
Deprecate kotlin.reflect.findAnnotation with ERROR
(cherry picked from commit cfe1591)
1 parent 277b1cb commit ab44f5c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/testData/codegen/box/reflection/annotations/findAnnotation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// IGNORE_BACKEND: JS
22
// WITH_REFLECT
33

4-
import kotlin.reflect.findAnnotation
4+
import kotlin.reflect.full.findAnnotation
55
import kotlin.test.assertNull
66

77
annotation class Yes(val value: String)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package kotlin.reflect
2020
/**
2121
* Returns an annotation of the given type on this element.
2222
*/
23-
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
23+
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.ERROR)
2424
@SinceKotlin("1.1")
2525
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
2626
@Suppress("UNCHECKED_CAST")

0 commit comments

Comments
 (0)