Skip to content

Commit cfe1591

Browse files
committed
Deprecate kotlin.reflect.findAnnotation with ERROR
1 parent 5987e8a commit cfe1591

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
@@ -22,7 +22,7 @@ package kotlin.reflect
2222
* Returns an annotation of the given type on this element.
2323
*/
2424
@kotlin.internal.LowPriorityInOverloadResolution
25-
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
25+
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.ERROR)
2626
@SinceKotlin("1.1")
2727
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
2828
@Suppress("UNCHECKED_CAST")

0 commit comments

Comments
 (0)