From 41f8819158df777ad5c06a1fdab06e38b6b2574f Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 23 Aug 2018 00:53:18 +0200 Subject: [PATCH] Deprecate Annotations.getUseSiteTargetedAnnotations --- .../kotlin/descriptors/annotations/AnnotationSplitter.kt | 2 +- .../jetbrains/kotlin/descriptors/annotations/Annotations.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt b/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt index e1841e3c6a5..23b7dce941b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt @@ -108,7 +108,7 @@ class AnnotationSplitter( other.add(annotation) } - for ((annotation, target) in allAnnotations.getUseSiteTargetedAnnotations()) { + for ((annotation, target) in @Suppress("DEPRECATION") allAnnotations.getUseSiteTargetedAnnotations()) { if (target in applicableTargets) { map.getOrPut(target) { arrayListOf() }.add(annotation) } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt index b03cbcfa075..9cc08c19a0c 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt @@ -29,6 +29,8 @@ interface Annotations : Iterable { fun hasAnnotation(fqName: FqName): Boolean = findAnnotation(fqName) != null + @Suppress("DeprecatedCallableAddReplaceWith") + @Deprecated("This method should only be used in frontend where we split annotations according to their use-site targets.") fun getUseSiteTargetedAnnotations(): List = emptyList() companion object { @@ -81,6 +83,7 @@ class CompositeAnnotations( override fun findAnnotation(fqName: FqName) = delegates.asSequence().mapNotNull { it.findAnnotation(fqName) }.firstOrNull() + @Suppress("DEPRECATION", "OverridingDeprecatedMember") override fun getUseSiteTargetedAnnotations() = delegates.flatMap { it.getUseSiteTargetedAnnotations() } override fun iterator() = delegates.asSequence().flatMap { it.asSequence() }.iterator()