[FIR] Don't check class super type annotations for loops
Only do it for typealiases. #KT-64059 Fixed
This commit is contained in:
committed by
Space Team
parent
984493fe8b
commit
242e16baea
+6
@@ -2100,6 +2100,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedAnnotationOnOuterClassDeclaration.kt")
|
||||||
|
public void testNestedAnnotationOnOuterClassDeclaration() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAnnotationOnOuterClassDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
||||||
public void testNestedClassAsAnnotationParameter() throws Exception {
|
public void testNestedClassAsAnnotationParameter() throws Exception {
|
||||||
|
|||||||
+6
@@ -2100,6 +2100,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedAnnotationOnOuterClassDeclaration.kt")
|
||||||
|
public void testNestedAnnotationOnOuterClassDeclaration() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAnnotationOnOuterClassDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
||||||
public void testNestedClassAsAnnotationParameter() throws Exception {
|
public void testNestedClassAsAnnotationParameter() throws Exception {
|
||||||
|
|||||||
+6
@@ -2094,6 +2094,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedAnnotationOnOuterClassDeclaration.kt")
|
||||||
|
public void testNestedAnnotationOnOuterClassDeclaration() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAnnotationOnOuterClassDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
||||||
public void testNestedClassAsAnnotationParameter() throws Exception {
|
public void testNestedClassAsAnnotationParameter() throws Exception {
|
||||||
|
|||||||
+6
@@ -2100,6 +2100,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedAnnotationOnOuterClassDeclaration.kt")
|
||||||
|
public void testNestedAnnotationOnOuterClassDeclaration() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAnnotationOnOuterClassDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
||||||
public void testNestedClassAsAnnotationParameter() throws Exception {
|
public void testNestedClassAsAnnotationParameter() throws Exception {
|
||||||
|
|||||||
+6
-4
@@ -721,10 +721,12 @@ open class SupertypeComputationSession {
|
|||||||
var isErrorInSupertypesFound = false
|
var isErrorInSupertypesFound = false
|
||||||
val resultSupertypeRefs = mutableListOf<FirResolvedTypeRef>()
|
val resultSupertypeRefs = mutableListOf<FirResolvedTypeRef>()
|
||||||
for (supertypeRef in supertypeRefs) {
|
for (supertypeRef in supertypeRefs) {
|
||||||
for (annotation in supertypeRef.annotations) {
|
if (isTypeAlias) {
|
||||||
val resolvedType = annotation.resolvedType as? ConeClassLikeType ?: continue
|
for (annotation in supertypeRef.annotations) {
|
||||||
val typeArgumentClassLikeDeclaration = resolvedType.lookupTag.toSymbol(session)?.fir
|
val resolvedType = annotation.resolvedType as? ConeClassLikeType ?: continue
|
||||||
checkIsInLoop(typeArgumentClassLikeDeclaration, wasSubtypingInvolved, wereTypeArgumentsInvolved)
|
val typeArgumentClassLikeDeclaration = resolvedType.lookupTag.toSymbol(session)?.fir
|
||||||
|
checkIsInLoop(typeArgumentClassLikeDeclaration, wasSubtypingInvolved, wereTypeArgumentsInvolved)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val supertypeFir = supertypeRef.firClassLike(session)
|
val supertypeFir = supertypeRef.firClassLike(session)
|
||||||
checkIsInLoop(supertypeFir, isSubtypingInvolved, wereTypeArgumentsInvolved)
|
checkIsInLoop(supertypeFir, isSubtypingInvolved, wereTypeArgumentsInvolved)
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-64059
|
||||||
|
|
||||||
|
interface OuterInterface
|
||||||
|
|
||||||
|
class MyClass: @MyClass.NestedAnnotation OuterInterface {
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE)
|
||||||
|
annotation class NestedAnnotation
|
||||||
|
}
|
||||||
Generated
+6
@@ -2100,6 +2100,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAliasWithNestedAnnotationInLocalClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedAnnotationOnOuterClassDeclaration.kt")
|
||||||
|
public void testNestedAnnotationOnOuterClassDeclaration() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/nestedAnnotationOnOuterClassDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
@TestMetadata("nestedClassAsAnnotationParameter.kt")
|
||||||
public void testNestedClassAsAnnotationParameter() throws Exception {
|
public void testNestedClassAsAnnotationParameter() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user