[Analysis API] Add a list of safe attributes to be restored to `ConeClassLikeTypePointer`
Safe attributes mean the attributes that can safely be copied to the restored type without any additional checks.
diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/utils/ConeTypePointer.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/utils/ConeTypePointer.kt
index 85b65e8..96b3d5f 100644
--- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/utils/ConeTypePointer.kt
+++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/utils/ConeTypePointer.kt
@@ -55,6 +55,7 @@
private val typeArgumentPointers = coneType.typeArguments.map { ConeTypeProjectionPointer(it, builder) }
private val isNullable = coneType.isMarkedNullable
private val abbreviatedTypePointer = coneType.abbreviatedType?.createPointer(builder)
+ private val safeAttributes = coneType.attributes.filter { it is ParameterNameTypeAttribute }
override fun restore(session: KaFirSession): ConeClassLikeTypeImpl? {
val typeArguments = typeArgumentPointers.map { it.restore(session) ?: return null }
@@ -64,6 +65,7 @@
if (abbreviatedType != null) {
add(AbbreviatedTypeAttribute(abbreviatedType))
}
+ addAll(safeAttributes)
}
return ConeClassLikeTypeImpl(