[AA LC] Save unresolved qualifier name in arguments of annotations
This commit is contained in:
committed by
Space Team
parent
ed867af01d
commit
95f5848e6c
+8
-6
@@ -201,16 +201,18 @@ internal fun KtAnnotationValue.toAnnotationMemberValue(parent: PsiElement): PsiA
|
||||
}
|
||||
|
||||
KtUnsupportedAnnotationValue -> null
|
||||
is KtKClassAnnotationValue.KtErrorClassAnnotationValue -> null
|
||||
is KtKClassAnnotationValue.KtLocalKClassAnnotationValue -> null
|
||||
is KtKClassAnnotationValue.KtNonLocalKClassAnnotationValue -> toAnnotationMemberValue(parent)
|
||||
is KtKClassAnnotationValue -> toAnnotationMemberValue(parent)
|
||||
}
|
||||
}
|
||||
|
||||
private fun KtKClassAnnotationValue.KtNonLocalKClassAnnotationValue.toAnnotationMemberValue(parent: PsiElement): PsiExpression? {
|
||||
val fqName = classId.asSingleFqName()
|
||||
private fun KtKClassAnnotationValue.toAnnotationMemberValue(parent: PsiElement): PsiExpression? {
|
||||
val typeString = when (this) {
|
||||
is KtKClassAnnotationValue.KtNonLocalKClassAnnotationValue -> classId.asSingleFqName().asString()
|
||||
is KtKClassAnnotationValue.KtLocalKClassAnnotationValue -> null
|
||||
is KtKClassAnnotationValue.KtErrorClassAnnotationValue -> unresolvedQualifierName
|
||||
} ?: return null
|
||||
val canonicalText = psiType(
|
||||
fqName.asString(), parent, boxPrimitiveType = false, /* TODO value.arrayNestedness > 0*/
|
||||
typeString, parent, boxPrimitiveType = false, /* TODO value.arrayNestedness > 0*/
|
||||
).let(TypeConversionUtil::erasure).getCanonicalText(false)
|
||||
return try {
|
||||
PsiElementFactory.getInstance(parent.project).createExpressionFromText("$canonicalText.class", parent)
|
||||
|
||||
-6
@@ -270,12 +270,6 @@ public class SymbolLightClassesByFqNameForLibraryTestGenerated extends AbstractS
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/TypePararametersInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typealiasInTypeArguments.kt")
|
||||
public void testTypealiasInTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/typealiasInTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
|
||||
-6
@@ -270,12 +270,6 @@ public class SymbolLightClassesParentingForLibraryTestGenerated extends Abstract
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/TypePararametersInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typealiasInTypeArguments.kt")
|
||||
public void testTypealiasInTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/typealiasInTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
|
||||
+6
-6
@@ -270,12 +270,6 @@ public class SymbolLightClassesByFqNameForSourceTestGenerated extends AbstractSy
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/TypePararametersInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typealiasInTypeArguments.kt")
|
||||
public void testTypealiasInTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/typealiasInTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
@@ -411,6 +405,12 @@ public class SymbolLightClassesByFqNameForSourceTestGenerated extends AbstractSy
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/compilationErrors/TwoOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unresolvedQuialifierInAnnotation.kt")
|
||||
public void testUnresolvedQuialifierInAnnotation() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/compilationErrors/unresolvedQuialifierInAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("WrongAnnotations.kt")
|
||||
public void testWrongAnnotations() throws Exception {
|
||||
|
||||
+6
-6
@@ -270,12 +270,6 @@ public class SymbolLightClassesParentingForSourceTestGenerated extends AbstractS
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/TypePararametersInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typealiasInTypeArguments.kt")
|
||||
public void testTypealiasInTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/typealiasInTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
@@ -411,6 +405,12 @@ public class SymbolLightClassesParentingForSourceTestGenerated extends AbstractS
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/compilationErrors/TwoOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unresolvedQuialifierInAnnotation.kt")
|
||||
public void testUnresolvedQuialifierInAnnotation() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/compilationErrors/unresolvedQuialifierInAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("WrongAnnotations.kt")
|
||||
public void testWrongAnnotations() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user