All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.seskar.compiler.union.backend.UnionTransformer.kt Maven / Gradle / Ivy

There is a newer version: 3.75.0
Show newest version
package seskar.compiler.union.backend

import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid

internal class UnionTransformer(
    private val context: IrPluginContext,
) : IrElementTransformerVoid() {
    override fun visitClass(declaration: IrClass): IrStatement {
        val unionBody = declaration.toJsUnionBody()
        if (unionBody != null) {
            declaration.annotations += JsName(context, declaration, unionBody)
        }

        return super.visitClass(declaration)
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy