FunctionDispatcher
open class FunctionDispatcher(functions: Collection<KCallable<Any?>>, matchNumbersLeniently: Boolean, matchClassesQualnames: Boolean, resolveAmbiguousSpecificity: Boolean)
Content copied to clipboard
Dynamic dispatch to one of multiple KCallables.
Uses reflection to narrow down functions to the one(s) that have the correct signature for a given array of arguments
Varargs can be used, but they must be supplied as a single correctly typed array instead of as separate arguments.
Constructors
FunctionDispatcher
Link copied to clipboard
fun FunctionDispatcher(functions: Collection<KCallable<Any?>>, matchNumbersLeniently: Boolean = false, matchClassesQualnames: Boolean = false, resolveAmbiguousSpecificity: Boolean = false)
Content copied to clipboard
Functions
checkParameterMatches
Link copied to clipboard
private fun checkParameterMatches(kparam: KParameter, arg: Any?, paramKtypeAppend: ArrayList<KType>): Boolean
Content copied to clipboard
nounifyFunctions
Link copied to clipboard
Properties
functions
Link copied to clipboard
matchClassesQualnames
Link copied to clipboard
matchNumbersLeniently
Link copied to clipboard
resolveAmbiguousSpecificity
Link copied to clipboard
Whether to try to resolve multiple ambiguous matching signatures by finding one that strictly subtypes all others. Rules for this are documented under getMostSpecificCallable. Does not add any extra steps unless needed; Increases function domain properly handled but does not decrease performance in other uses.
Inheritors
Reflection
Link copied to clipboard
Sources
jvm source
Link copied to clipboard