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

commonMain.com.sunnychung.lib.multiplatform.kotlite.model.FindCallableResult.kt Maven / Gradle / Ivy

Go to download

A Kotlin Multiplatform library to interpret Kotlite code, which is a subset of Kotlin language, in runtime in a safe way.

The newest version!
package com.sunnychung.lib.multiplatform.kotlite.model

data class FindCallableResult(
    val transformedName: String,
    val originalName: String,
    val owner: String?,
    val type: CallableType,
    val isVararg: Boolean,
    val arguments: List, // either DataType or FunctionValueParameterNode
    val typeParameters: List,
    val receiverType: TypeNode?,
    val returnType: TypeNode,
    val signature: String,
    val definition: Any,
    var isSpecialFunction: Boolean = false,
    val scope: SymbolTable,
) {
    fun toDisplayableSignature() = buildString {
        if (receiverType != null) {
            append("${receiverType.descriptiveName()}.")
        }
        append(originalName)
        append("(")
        append(arguments.joinToString(", ") { when (it) {
            is DataType -> it.descriptiveName
            is FunctionValueParameterNode -> it.type.descriptiveName()
            else -> throw UnsupportedOperationException()
        } })
        append(")")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy