diff --git a/core/reflection.jvm/src/kotlin/reflect/full/KAnnotatedElements.kt b/core/reflection.jvm/src/kotlin/reflect/full/KAnnotatedElements.kt index 38107bcbe1e..86f78adc2be 100644 --- a/core/reflection.jvm/src/kotlin/reflect/full/KAnnotatedElements.kt +++ b/core/reflection.jvm/src/kotlin/reflect/full/KAnnotatedElements.kt @@ -36,8 +36,9 @@ inline fun KAnnotatedElement.hasAnnotation(): Boolean = * in Java reflection ([java.lang.reflect.AnnotatedElement.getAnnotationsByType]). This is supported both for Kotlin-repeatable * ([kotlin.annotation.Repeatable]) and Java-repeatable ([java.lang.annotation.Repeatable]) annotation classes. */ -@SinceKotlin("1.5") -@ExperimentalStdlibApi +@SinceKotlin("1.7") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@WasExperimental(ExperimentalStdlibApi::class) inline fun KAnnotatedElement.findAnnotations(): List = findAnnotations(T::class) @@ -49,9 +50,9 @@ inline fun KAnnotatedElement.findAnnotations(): List * in Java reflection ([java.lang.reflect.AnnotatedElement.getAnnotationsByType]). This is supported both for Kotlin-repeatable * ([kotlin.annotation.Repeatable]) and Java-repeatable ([java.lang.annotation.Repeatable]) annotation classes. */ -@Suppress("UNCHECKED_CAST") -@SinceKotlin("1.5") -@ExperimentalStdlibApi +@SinceKotlin("1.7") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@WasExperimental(ExperimentalStdlibApi::class) fun KAnnotatedElement.findAnnotations(klass: KClass): List { val filtered = annotations.filterIsInstance(klass.java) if (filtered.isNotEmpty()) return filtered @@ -62,6 +63,7 @@ fun KAnnotatedElement.findAnnotations(klass: KClass): List).asList() } }