
commonMain.co.touchlab.skie.oir.element.OirFunction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-plugin Show documentation
Show all versions of kotlin-plugin Show documentation
Kotlin compiler plugin that improves Swift interface of a Kotlin Multiplatform framework.
The newest version!
package co.touchlab.skie.oir.element
import co.touchlab.skie.oir.type.OirType
abstract class OirFunction(
final override val parent: OirCallableDeclarationParent,
) : OirCallableDeclaration {
abstract val selector: String
abstract val errorHandlingStrategy: ErrorHandlingStrategy
abstract val returnType: OirType?
val baseSelector: String
get() = selector.substringBefore(':')
val valueParameters: MutableList = mutableListOf()
init {
@Suppress("LeakingThis")
parent.callableDeclarations.add(this)
}
override fun toString(): String = "${this::class.simpleName}: $selector"
enum class ErrorHandlingStrategy {
Crashes,
ReturnsBoolean,
ReturnsZero,
SetsErrorOut;
val isThrowing: Boolean
get() = this != Crashes
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy