[FIR] Introduce deprecated FirExpression.typeRef property for compatibility with Compose

#KT-59855
This commit is contained in:
Kirill Rakhman
2023-08-07 16:51:56 +02:00
committed by Space Team
parent a5cff6ae36
commit ab6d87a1a2
3 changed files with 12 additions and 0 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.tree.generator.printer
import org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder
import org.jetbrains.kotlin.fir.tree.generator.context.AbstractFirTreeBuilder
import org.jetbrains.kotlin.fir.tree.generator.model.Element
import org.jetbrains.kotlin.fir.tree.generator.model.Field
@@ -147,7 +148,14 @@ fun SmartPrinter.printElement(element: Element) {
println()
println("fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement")
}
if (element == FirTreeBuilder.expression) {
println()
println("/** DO NOT USE! Only for temporary compatibility with Compose. Will be removed soon. KT-61312*/")
println("val typeRef: org.jetbrains.kotlin.fir.types.FirTypeRef get() = coneTypeOrNull?.let { org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef { type = it } } ?: org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImplWithoutSource")
}
}
println("}")
}
}