Deprecate Annotations.getUseSiteTargetedAnnotations

This commit is contained in:
Alexander Udalov
2018-08-23 00:53:18 +02:00
parent 7658ddafd8
commit 41f8819158
2 changed files with 4 additions and 1 deletions
@@ -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)
}
@@ -29,6 +29,8 @@ interface Annotations : Iterable<AnnotationDescriptor> {
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<AnnotationWithTarget> = 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()