convertArgument

inline fun <T> convertArgument(raw: Any, parameter: FunctionParameter, call: FunctionCall<*>, noinline factory: (Any) -> Value<*>?): Value<*>

Converts a function call argument to the static type a parameter expects, keeping it wrapped.

This is the single conversion entry point. The choice of factory is made at build time by the native library processor, so no type-to-factory lookup happens here.

Return

a value wrapping a T

Parameters

raw

the bound argument, normally a Value

parameter

the parameter being filled, used for nullability and error reporting

call

the call being executed, used for error reporting

factory

the build-time-selected conversion, invoked only when no cheaper path applies

Type Parameters

T

the static type to produce

Throws

if no path produces a T