[FE] Detect recursion when typealias referenced as annotation in its RHS
#KT-14612 Fixed
This commit is contained in:
@@ -79,6 +79,23 @@ class FilteredAnnotations(
|
||||
}
|
||||
}
|
||||
|
||||
class FilteredByPredicateAnnotations(
|
||||
private val delegate: Annotations,
|
||||
private val filter: (AnnotationDescriptor) -> Boolean
|
||||
) : Annotations {
|
||||
override fun isEmpty(): Boolean {
|
||||
return !iterator().hasNext()
|
||||
}
|
||||
|
||||
override fun iterator(): Iterator<AnnotationDescriptor> {
|
||||
return delegate.filter(filter).iterator()
|
||||
}
|
||||
|
||||
override fun findAnnotation(fqName: FqName): AnnotationDescriptor? {
|
||||
return super.findAnnotation(fqName)?.takeIf(filter)
|
||||
}
|
||||
}
|
||||
|
||||
class CompositeAnnotations(
|
||||
private val delegates: List<Annotations>
|
||||
) : Annotations {
|
||||
|
||||
Reference in New Issue
Block a user