FIR: handle custom attributes more precise
This commit is contained in:
committed by
teamcityserver
parent
4f70f47fa6
commit
77dd0ad396
Generated
+6
@@ -2314,6 +2314,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
||||
runTest("compiler/testData/ir/irText/firProblems/throwableStackTrace.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TypeParameterBounds.kt")
|
||||
public void testTypeParameterBounds() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParameterFromJavaClass.kt")
|
||||
public void testTypeParameterFromJavaClass() throws Exception {
|
||||
|
||||
@@ -115,11 +115,13 @@ fun List<FirAnnotationCall>.computeTypeAttributes(
|
||||
CompilerConeAttributes.ExtensionFunctionType.ANNOTATION_CLASS_ID -> attributes += CompilerConeAttributes.ExtensionFunctionType
|
||||
CompilerConeAttributes.UnsafeVariance.ANNOTATION_CLASS_ID -> attributes += CompilerConeAttributes.UnsafeVariance
|
||||
else -> {
|
||||
if (classId.startsWith(StandardClassIds.BASE_KOTLIN_PACKAGE.shortName())) {
|
||||
// The check ^ is intended to leave only annotations which may be important for BE
|
||||
val annotationAttributes = mutableListOf<ConeAttribute<*>>()
|
||||
additionalProcessor.invoke(annotationAttributes, classId)
|
||||
if (annotationAttributes.isEmpty()) {
|
||||
customAnnotations += annotation
|
||||
} else {
|
||||
attributes += annotationAttributes
|
||||
}
|
||||
additionalProcessor.invoke(attributes, classId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user