Object left = machine.getArg(0, nArgCount);
Primitive leftType = Primitive.primitiveOf(left);
Primitive rightType, coercedType = null;
BinaryFunction fun;
Object right;
for (int i = 1; i < nArgCount; ++i)
{
right = machine.getArg(i, nArgCount);
rightType = Primitive.primitiveOf(right);
if (leftType == null)
{
if (rightType != null)
{
coercedType = rightType;
}
}
else if (rightType == null)
{
coercedType = leftType;
}
else
{
coercedType = getCoercedType(leftType, rightType);
}
if (coercedType != null)
{
if (leftType != coercedType)
{
left = coercedType.getConverter(leftType).invoke(left);
leftType = coercedType;
}
if (rightType != coercedType)
{
right = coercedType.getConverter(rightType).invoke(right);
}
if ((fun = m_functionArray[coercedType.getOrdinal()]) == null)
{
throw new TypeMismatchException(getSymbol());
}
if (fun.invoke(left, right) == m_stopResult)
{
machine.returnValue(m_stopResult, nArgCount);
return false;
}