in compiler/frontend.common/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt [815:952]
fun checkBinaryOp(
name: String, leftType: CompileTimeType, left: BigInteger, rightType: CompileTimeType, right: BigInteger
): BigInteger? {
when (leftType) {
BYTE -> when (rightType) {
BYTE -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
SHORT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
INT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
LONG -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
else -> {}
}
INT -> when (rightType) {
INT -> when (name) {
"and" -> return left.and(right)
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"or" -> return left.or(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
"xor" -> return left.xor(right)
}
BYTE -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
SHORT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
LONG -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
else -> {}
}
LONG -> when (rightType) {
LONG -> when (name) {
"and" -> return left.and(right)
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"or" -> return left.or(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
"xor" -> return left.xor(right)
}
BYTE -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
SHORT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
INT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
else -> {}
}
SHORT -> when (rightType) {
BYTE -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
SHORT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
INT -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
LONG -> when (name) {
"div" -> return left.divide(right)
"minus" -> return left.subtract(right)
"plus" -> return left.add(right)
"rem" -> return left.rem(right)
"times" -> return left.multiply(right)
}
else -> {}
}
else -> {}
}
return null
}