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

main.seskar.compiler.primitive.backend.JsPrimitive.kt Maven / Gradle / Ivy

There is a newer version: 3.32.0
Show newest version
package seskar.compiler.primitive.backend

import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.getClass
import org.jetbrains.kotlin.ir.util.hasAnnotation
import org.jetbrains.kotlin.name.FqName

private val JS_PRIMITIVE = FqName("seskar.js.JsPrimitive")

internal fun getPrimitiveTypeName(
    type: IrType,
): String? {
    val clazz = type.getClass()
        ?: return null

    if (!clazz.hasAnnotation(JS_PRIMITIVE))
        return null

    return clazz.name.identifier.lowercase()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy