if (parameter != null)
{
final TypeValuePair result = parameter.evaluate();
// lets do some type checking, right?
final TypeRegistry typeRegistry = function.getContext().getTypeRegistry();
final TypeValuePair converted = typeRegistry.convertTo(paramType, result);
if (converted == null)
{
Log.debug("Failed to evaluate parameter " + pos + " on function " + function);
throw new EvaluationException(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE);
}