in daffodil-core/src/main/scala/org/apache/daffodil/core/dpath/NodeInfoUtils.scala [30:78]
def generalizeArgTypesForComparisonOp(
op: String,
inherent1: Numeric.Kind,
inherent2: Numeric.Kind
): Numeric.Kind = {
val argType: Numeric.Kind = (inherent1, inherent2) match {
case (x, y) if (x eq y) => x
case (_, Decimal) => Decimal
case (Decimal, _) => Decimal
case (_, Double) => Double
case (Double, _) => Double
case (_, Float) => Double
case (Float, _) => Double
case (_, Integer) => Integer
case (Integer, _) => Integer
case (_, NonNegativeInteger) => Integer
case (NonNegativeInteger, _) => Integer
case (_: UnsignedLong.Kind, UnsignedLong) => UnsignedLong
case (UnsignedLong, _: UnsignedLong.Kind) => UnsignedLong
case (_, UnsignedLong) => Integer
case (UnsignedLong, _) => Integer
case (_, ArrayIndex) => ArrayIndex
case (ArrayIndex, _) => ArrayIndex
case (_, Long) => Long
case (Long, _) => Long
case (_, UnsignedInt) => Long
case (UnsignedInt, _) => Long
case (_, Int) => Int
case (Int, _) => Int
case (_, UnsignedShort) => Int
case (UnsignedShort, _) => Int
case (_, Short) => Short
case (Short, _) => Short
case (_, UnsignedByte) => Short
case (UnsignedByte, _) => Short
case (_, Byte) => Byte
case (Byte, _) => Byte
case _ =>
Assert.usageError(
"Unsupported types for comparison op '%s' were %s and %s.".format(
op,
inherent1,
inherent2
)
)
}
argType
}