FIR: handle custom attributes more precise

This commit is contained in:
Mikhail Glukhikh
2021-05-31 13:00:22 +03:00
committed by teamcityserver
parent 4f70f47fa6
commit 77dd0ad396
9 changed files with 419 additions and 9 deletions
@@ -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)
}
}
}