diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt index 13202d1cf6c..d0191ab0537 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/renderer/ConeAttributeRenderer.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.fir.renderer import org.jetbrains.kotlin.fir.types.ConeAttribute +import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty abstract class ConeAttributeRenderer { abstract fun render(attributes: Iterable>): String @@ -17,6 +18,6 @@ abstract class ConeAttributeRenderer { object ForReadability : ConeAttributeRenderer() { override fun render(attributes: Iterable>): String = - attributes.joinToString(separator = " ", postfix = " ") { it.renderForReadability() } + attributes.mapNotNull { it.renderForReadability() }.ifNotEmpty { joinToString(separator = " ", postfix = " ") } ?: "" } } diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt index 70a30597420..9855a3ac261 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeAttributes.kt @@ -30,7 +30,7 @@ abstract class ConeAttribute> : AnnotationMarker { abstract fun isSubtypeOf(other: @UnsafeVariance T?): Boolean abstract override fun toString(): String - open fun renderForReadability(): String = toString() + open fun renderForReadability(): String? = null abstract val key: KClass