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
@@ -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<AnnotationWithTarget> = emptyList()
override fun iterator(): Iterator<AnnotationDescriptor> = annotations.iterator()
}