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 7e83d6418f3..f531ecf4a0d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationSplitter.kt @@ -146,7 +146,6 @@ class AnnotationSplitter( override fun isEmpty() = annotations.isEmpty() override fun hasAnnotation(fqName: FqName) = annotations.hasAnnotation(fqName) override fun findAnnotation(fqName: FqName) = annotations.findAnnotation(fqName) - override fun getUseSiteTargetedAnnotations() = annotations.getUseSiteTargetedAnnotations() override fun iterator() = annotations.iterator() override fun toString() = annotations.toString() } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyAnnotations.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyAnnotations.kt index d4a593de254..0753c42af28 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyAnnotations.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyAnnotations.kt @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.resolve.lazy.descriptors import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.KtAnnotationEntry @@ -59,8 +58,6 @@ class LazyAnnotations( LazyAnnotationDescriptor(c, entry) } - override fun getUseSiteTargetedAnnotations(): List = emptyList() - override fun iterator(): Iterator = annotationEntries.asSequence().map(annotation).iterator() override fun forceResolveAllContents() { diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/LazyJavaAnnotations.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/LazyJavaAnnotations.kt index 31a542db952..e0f8398f5cb 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/LazyJavaAnnotations.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/LazyJavaAnnotations.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.load.java.lazy import org.jetbrains.kotlin.builtins.KotlinBuiltIns -import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.load.java.components.JavaAnnotationMapper import org.jetbrains.kotlin.load.java.structure.JavaAnnotation @@ -36,8 +35,6 @@ class LazyJavaAnnotations( annotationOwner.findAnnotation(fqName)?.let(annotationDescriptors) ?: JavaAnnotationMapper.findMappedJavaAnnotation(fqName, annotationOwner, c) - override fun getUseSiteTargetedAnnotations() = emptyList() - override fun iterator() = (annotationOwner.annotations.asSequence().map(annotationDescriptors) + JavaAnnotationMapper.findMappedJavaAnnotation(KotlinBuiltIns.FQ_NAMES.deprecated, annotationOwner, c)).filterNotNull().iterator() diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt index d70e80b648f..bdb28502d39 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt @@ -21,7 +21,6 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.ClassifierDescriptor import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.annotations.CompositeAnnotations import org.jetbrains.kotlin.load.java.JvmAnnotationNames @@ -198,8 +197,6 @@ private class EnhancedTypeAnnotations(private val fqNameToMatch: FqName) : Annot else -> null } - override fun getUseSiteTargetedAnnotations() = emptyList() - // Note, that this class may break Annotations contract (!isEmpty && iterator.isEmpty()) // It's a hack that we need unless we have stable "user data" in JetType override fun iterator(): Iterator = emptyList().iterator() 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 a937a8de4bf..d4941dd0426 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt @@ -35,7 +35,7 @@ interface Annotations : Iterable { fun hasAnnotation(fqName: FqName): Boolean = findAnnotation(fqName) != null - fun getUseSiteTargetedAnnotations(): List + fun getUseSiteTargetedAnnotations(): List = emptyList() companion object { val EMPTY: Annotations = object : Annotations { @@ -43,8 +43,6 @@ interface Annotations : Iterable { override fun findAnnotation(fqName: FqName) = null - override fun getUseSiteTargetedAnnotations() = emptyList() - override fun iterator() = emptyList().iterator() override fun toString() = "EMPTY" @@ -65,10 +63,6 @@ class FilteredAnnotations( if (fqNameFilter(fqName)) delegate.findAnnotation(fqName) else null - override fun getUseSiteTargetedAnnotations(): List { - return delegate.getUseSiteTargetedAnnotations().filter { shouldBeReturned(it.annotation) } - } - override fun iterator() = delegate.filter(this::shouldBeReturned).iterator() override fun isEmpty() = delegate.any(this::shouldBeReturned) diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/annotationsForResolve.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/annotationsForResolve.kt index 5aac2ee4397..80059a63a45 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/annotationsForResolve.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/annotationsForResolve.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.resolve.descriptorUtil import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name @@ -48,6 +47,4 @@ private class AnnotationsWithOnly(val presentAnnotation: FqName): Annotations { override fun isEmpty(): Boolean = false override fun hasAnnotation(fqName: FqName): Boolean = fqName == this.presentAnnotation - - override fun getUseSiteTargetedAnnotations(): List = emptyList() } diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedAnnotations.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedAnnotations.kt index d634e26a1b0..d28720c7fcd 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedAnnotations.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedAnnotations.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.serialization.deserialization.descriptors import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.storage.getValue @@ -30,8 +29,6 @@ open class DeserializedAnnotations( override fun isEmpty(): Boolean = annotations.isEmpty() - override fun getUseSiteTargetedAnnotations(): List = emptyList() - override fun iterator(): Iterator = annotations.iterator() }