Provide default implementation for Annotations.getUseSiteTargetedAnnotations

After this commit, it's overridden only in AnnotationsImpl and
CompositeAnnotations.

Note that although FilteredAnnotations did have a non-trivial
implementation, that class was only used in circumstances where
annotations with use-site targets could not be of any use, so it's safe
to return empty list there now. One could argue that the new semantics
makes more sense: filter "standard" annotations, but don't touch those
with use-site targets because they are not applied to this element
directly, thus should likely not be affected by the filtering
This commit is contained in:
Alexander Udalov
2018-08-22 19:57:50 +02:00
parent f9b9b6908a
commit c0b025b23d
7 changed files with 1 additions and 23 deletions
@@ -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()
}
@@ -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<AnnotationWithTarget> = emptyList()
override fun iterator(): Iterator<AnnotationDescriptor> = annotationEntries.asSequence().map(annotation).iterator()
override fun forceResolveAllContents() {