[IR] Convert methods in IrConstantValue classes to extension functions

to get rid of custom logic inside generated classes.

#KT-65773 In Progress
This commit is contained in:
Wojciech Litewka
2024-02-29 10:57:25 +01:00
committed by Space Team
parent 42668e2bf6
commit baaaf4567e
6 changed files with 81 additions and 79 deletions
@@ -951,27 +951,9 @@ object IrTree : AbstractTreeBuilder() {
}
val constantValue: Element by element(Expression) {
transformByChildren = true
kind = ImplementationKind.SealedClass
parent(expression)
generationCallback = {
println()
printFunctionDeclaration(
name = "contentEquals",
parameters = listOf(FunctionParameter("other", constantValue)),
returnType = StandardTypes.boolean,
modality = Modality.ABSTRACT,
)
println()
println()
printFunctionDeclaration(
name = "contentHashCode",
parameters = emptyList(),
returnType = StandardTypes.int,
modality = Modality.ABSTRACT,
)
println()
}
}
val constantPrimitive: Element by element(Expression) {
parent(constantValue)