commonMain.com.sunnychung.lib.multiplatform.kotlite.model.FindCallableResult.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlite-interpreter-jvm Show documentation
Show all versions of kotlite-interpreter-jvm Show documentation
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(")")
}
}