Support reading from class files of the type use annotations on type parameters and type arguments

^KT-11454 Fixed
This commit is contained in:
Victor Petukhov
2020-12-01 18:21:44 +03:00
parent 0833719a79
commit a89329e077
54 changed files with 2077 additions and 262 deletions
@@ -29,9 +29,9 @@ interface JavaNamedElement : JavaElement {
interface JavaAnnotationOwner : JavaElement {
val annotations: Collection<JavaAnnotation>
fun findAnnotation(fqName: FqName): JavaAnnotation?
val isDeprecatedInJavaDoc: Boolean
fun findAnnotation(fqName: FqName): JavaAnnotation?
}
interface JavaModifierListOwner : JavaElement {
@@ -56,9 +56,17 @@ interface JavaAnnotation : JavaElement {
interface MapBasedJavaAnnotationOwner : JavaAnnotationOwner {
val annotationsByFqName: Map<FqName?, JavaAnnotation>
override val isDeprecatedInJavaDoc: Boolean get() = false
override fun findAnnotation(fqName: FqName) = annotationsByFqName[fqName]
override val isDeprecatedInJavaDoc: Boolean
get() = false
}
interface ListBasedJavaAnnotationOwner : JavaAnnotationOwner {
override fun findAnnotation(fqName: FqName) = annotations.find { it.classId?.asSingleFqName() == fqName }
}
interface MutableJavaAnnotationOwner : JavaAnnotationOwner {
override val annotations: MutableCollection<JavaAnnotation>
}
fun JavaAnnotationOwner.buildLazyValueForMap() = lazy {
@@ -18,13 +18,13 @@ package org.jetbrains.kotlin.load.java.structure
import org.jetbrains.kotlin.builtins.PrimitiveType
interface JavaType
interface JavaType : ListBasedJavaAnnotationOwner
interface JavaArrayType : JavaType {
val componentType: JavaType
}
interface JavaClassifierType : JavaType, JavaAnnotationOwner {
interface JavaClassifierType : JavaType {
val classifier: JavaClassifier?
val typeArguments: List<JavaType?>