[FIR] Render attributes on function types.

Only render if there are non-compiler attributes to reduce
noise from extension function types.
This commit is contained in:
Mads Ager
2023-05-10 11:48:48 +02:00
committed by teamcity
parent 089928ba2b
commit a5157aa239
@@ -25,6 +25,8 @@ open class ConeTypeRenderer {
return return
} }
type.renderNonCompilerAttributes()
if (type.isMarkedNullable) { if (type.isMarkedNullable) {
builder.append("(") builder.append("(")
} }
@@ -180,6 +182,13 @@ open class ConeTypeRenderer {
builder.append(attributeRenderer.render(attributes)) builder.append(attributeRenderer.render(attributes))
} }
private fun ConeKotlinType.renderNonCompilerAttributes() {
val compilerAttributes = CompilerConeAttributes.classIdByCompilerAttributeKey
if (attributes.any { it.key !in compilerAttributes }) {
builder.append(attributeRenderer.render(attributes))
}
}
private fun ConeTypeProjection.render() { private fun ConeTypeProjection.render() {
when (this) { when (this) {
ConeStarProjection -> { ConeStarProjection -> {