Remove mod function usage from tests

#KT-26654
This commit is contained in:
Ilya Gorbunov
2020-01-17 22:39:44 +03:00
parent 9fffa61596
commit b1766b167f
22 changed files with 83 additions and 164 deletions
@@ -21,7 +21,6 @@ val l20: Int = 30 * 24 * 60 * 60 * 1000
val l21: Int = intMinValue - intMinValue
val l22: Int = intMinValue + -intMinValue
val l23: Int = intMaxValue + -intMinValue
val l24: Int = (-1).mod(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
@@ -45,7 +44,6 @@ fun foo() {
val l21: Int = intMinValue - intMinValue
val l22: Int = intMinValue + -intMinValue
val l23: Int = intMaxValue + -intMinValue
val l24: Int = (-1).mod(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
}
@@ -70,7 +68,6 @@ class A {
val l21: Int = intMinValue - intMinValue
val l22: Int = intMinValue + -intMinValue
val l23: Int = intMaxValue + -intMinValue
val l24: Int = (-1).mod(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
}
@@ -21,7 +21,6 @@ val l20: Int = <!INTEGER_OVERFLOW!>30 * 24 * 60 * 60 * 1000<!>
val l21: Int = intMinValue - intMinValue
val l22: Int = <!INTEGER_OVERFLOW!>intMinValue + <!INTEGER_OVERFLOW!>-intMinValue<!><!>
val l23: Int = intMaxValue + <!INTEGER_OVERFLOW!>-intMinValue<!>
val l24: Int = (-1).<!DEPRECATION_ERROR!>mod<!>(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
@@ -45,7 +44,6 @@ fun foo() {
val l21: Int = intMinValue - intMinValue
val l22: Int = <!INTEGER_OVERFLOW!>intMinValue + <!INTEGER_OVERFLOW!>-intMinValue<!><!>
val l23: Int = intMaxValue + <!INTEGER_OVERFLOW!>-intMinValue<!>
val l24: Int = (-1).<!DEPRECATION_ERROR!>mod<!>(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
}
@@ -70,7 +68,6 @@ class A {
val l21: Int = intMinValue - intMinValue
val l22: Int = <!INTEGER_OVERFLOW!>intMinValue + <!INTEGER_OVERFLOW!>-intMinValue<!><!>
val l23: Int = intMaxValue + <!INTEGER_OVERFLOW!>-intMinValue<!>
val l24: Int = (-1).<!DEPRECATION_ERROR!>mod<!>(5)
val l25: Int = (-1).rem(5)
val l26: Int = (-1) % 5
}
@@ -20,7 +20,6 @@ public val l20: kotlin.Int = -1702967296
public val l21: kotlin.Int = 0
public val l22: kotlin.Int = 0
public val l23: kotlin.Int = -1
public val l24: kotlin.Int = -1
public val l25: kotlin.Int = -1
public val l26: kotlin.Int = -1
public fun foo(): kotlin.Unit
@@ -19,11 +19,6 @@ fun test() {
fooLong(1.div(1))
fooShort(1.div(1))
fooInt(1.mod(1))
<!INAPPLICABLE_CANDIDATE!>fooByte<!>(1.mod(1))
<!INAPPLICABLE_CANDIDATE!>fooLong<!>(1.mod(1))
<!INAPPLICABLE_CANDIDATE!>fooShort<!>(1.mod(1))
fooInt(1.rem(1))
fooByte(1.rem(1))
fooLong(1.rem(1))
@@ -19,11 +19,6 @@ fun test() {
fooLong(1.div(1))
fooShort(1.div(1))
fooInt(1.<!DEPRECATION_ERROR!>mod<!>(1))
fooByte(1.<!DEPRECATION_ERROR!>mod<!>(1))
fooLong(1.<!DEPRECATION_ERROR!>mod<!>(1))
fooShort(1.<!DEPRECATION_ERROR!>mod<!>(1))
fooInt(1.rem(1))
fooByte(1.rem(1))
fooLong(1.rem(1))
@@ -19,11 +19,6 @@ fun test() {
fooLong(1 div 1)
fooShort(1 div 1)
fooInt(1 mod 1)
<!INAPPLICABLE_CANDIDATE!>fooByte<!>(1 mod 1)
<!INAPPLICABLE_CANDIDATE!>fooLong<!>(1 mod 1)
<!INAPPLICABLE_CANDIDATE!>fooShort<!>(1 mod 1)
fooInt(1 rem 1)
fooByte(1 rem 1)
fooLong(1 rem 1)
@@ -19,11 +19,6 @@ fun test() {
fooLong(1 <!INFIX_MODIFIER_REQUIRED!>div<!> 1)
fooShort(1 <!INFIX_MODIFIER_REQUIRED!>div<!> 1)
fooInt(1 <!DEPRECATION_ERROR, INFIX_MODIFIER_REQUIRED!>mod<!> 1)
fooByte(1 <!DEPRECATION_ERROR, INFIX_MODIFIER_REQUIRED!>mod<!> 1)
fooLong(1 <!DEPRECATION_ERROR, INFIX_MODIFIER_REQUIRED!>mod<!> 1)
fooShort(1 <!DEPRECATION_ERROR, INFIX_MODIFIER_REQUIRED!>mod<!> 1)
fooInt(1 <!INFIX_MODIFIER_REQUIRED!>rem<!> 1)
fooByte(1 <!INFIX_MODIFIER_REQUIRED!>rem<!> 1)
fooLong(1 <!INFIX_MODIFIER_REQUIRED!>rem<!> 1)
@@ -82,7 +82,6 @@ const val nonConstInitializer9 = 1.0/0.0 - 1/0
const val nonConstInitializer10 = 0/0
const val nonConstInitializer11 = 1 % 0
const val nonConstInitializer12 = 0 % 0
const val nonConstInitializer13 = 0.mod(0)
const val nonConstInitializer14 = 0.rem(0)
const val nonConstInitializer15 = 0.div(0)
@@ -99,7 +98,6 @@ const val constInitializer10 = 1.0 % 0
const val constInitializer11 = 0.0 % 0
const val constInitializer12 = (-1.0) % 0
const val constInitializer13 = 1.0.rem(0)
const val constInitializer14 = 1.0.mod(0)
const val constInitializer15 = 1.0.div(0)
// ------------------
@@ -82,7 +82,6 @@ const val nonConstInitializer9 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0/0.0
const val nonConstInitializer10 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0/0<!>
const val nonConstInitializer11 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1 % 0<!>
const val nonConstInitializer12 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0 % 0<!>
const val nonConstInitializer13 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.<!DEPRECATION_ERROR!>mod<!>(0)<!>
const val nonConstInitializer14 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.rem(0)<!>
const val nonConstInitializer15 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.div(0)<!>
@@ -99,7 +98,6 @@ const val constInitializer10 = 1.0 % 0
const val constInitializer11 = 0.0 % 0
const val constInitializer12 = (-1.0) % 0
const val constInitializer13 = 1.0.rem(0)
const val constInitializer14 = 1.0.<!DEPRECATION_ERROR!>mod<!>(0)
const val constInitializer15 = 1.0.div(0)
// ------------------
@@ -5,7 +5,6 @@ public const val constInitializer10: kotlin.Double = NaN.toDouble()
public const val constInitializer11: kotlin.Double = NaN.toDouble()
public const val constInitializer12: kotlin.Double = NaN.toDouble()
public const val constInitializer13: kotlin.Double = NaN.toDouble()
public const val constInitializer14: kotlin.Double = NaN.toDouble()
public const val constInitializer15: kotlin.Double = Infinity.toDouble()
public const val constInitializer2: kotlin.Double = Infinity.toDouble()
public const val constInitializer3: kotlin.Double = Infinity.toDouble()
@@ -21,7 +20,6 @@ public const val nonConstInitializer1: kotlin.Int
public const val nonConstInitializer10: kotlin.Int
public const val nonConstInitializer11: kotlin.Int
public const val nonConstInitializer12: kotlin.Int
public const val nonConstInitializer13: kotlin.Int
public const val nonConstInitializer14: kotlin.Int
public const val nonConstInitializer15: kotlin.Int
public const val nonConstInitializer2: kotlin.String
@@ -6,7 +6,6 @@ const val b = 1.0 / 0
const val c = 0.0 / 0
const val d = 1.0 % 0
const val e = 0.0 % 0
const val f = 0.0.mod(0)
const val g = 0.0.rem(0)
const val h = 0.0.div(0)
@@ -16,6 +15,5 @@ val nonConst1 = 1.0 / 0
val nonConst2 = 1 / 0
val nonConst3 = 1.0 % 0
val nonConst4 = 1 % 0
val nonConst5 = 1.mod(0)
val nonConst6 = 1.rem(0)
val nonConst7 = 1.div(0)
@@ -6,7 +6,6 @@ const val b = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0 / 0<!>
const val c = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.0 / 0<!>
const val d = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0 % 0<!>
const val e = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.0 % 0<!>
const val f = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.0.<!DEPRECATION_ERROR!>mod<!>(0)<!>
const val g = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.0.rem(0)<!>
const val h = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>0.0.div(0)<!>
@@ -16,6 +15,5 @@ val nonConst1 = 1.0 / 0
val nonConst2 = 1 / 0
val nonConst3 = 1.0 % 0
val nonConst4 = 1 % 0
val nonConst5 = 1.<!DEPRECATION_ERROR!>mod<!>(0)
val nonConst6 = 1.rem(0)
val nonConst7 = 1.div(0)
@@ -5,7 +5,6 @@ public const val b: kotlin.Double
public const val c: kotlin.Double
public const val d: kotlin.Double
public const val e: kotlin.Double
public const val f: kotlin.Double
public const val g: kotlin.Double
public const val h: kotlin.Double
public const val i: kotlin.Int
@@ -13,6 +12,5 @@ public val nonConst1: kotlin.Double
public val nonConst2: kotlin.Int
public val nonConst3: kotlin.Double
public val nonConst4: kotlin.Int
public val nonConst5: kotlin.Int
public val nonConst6: kotlin.Int
public val nonConst7: kotlin.Int
@@ -23,14 +23,10 @@ fun local() {
operator fun String.remAssign(x: Int) {}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a %= 3
1.mod(2)
var d = 5
d %= 3
b % s
1.0 % 2.0
}
@@ -23,14 +23,10 @@ fun local() {
<!UNSUPPORTED_FEATURE!>operator<!> fun String.remAssign(x: Int) {}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a %= 3
1.mod(2)
b % s
1.0 % 2.0
var a = 1 <!UNRESOLVED_REFERENCE!>%<!> 2
var d = 5
d <!UNRESOLVED_REFERENCE!>%=<!> 3
b <!UNRESOLVED_REFERENCE!>%<!> s
1.0 <!UNRESOLVED_REFERENCE!>%<!> 2.0
}
@@ -2,7 +2,6 @@ package
public fun builtIns(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short): kotlin.Unit
public fun local(): kotlin.Unit
public fun noOverflow(): kotlin.Unit
public operator fun Baz.rem(/*0*/ x: kotlin.Int): kotlin.Unit
public final class Bar {
@@ -137,12 +137,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(BYTE, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(BYTE, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(BYTE, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(BYTE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -179,12 +179,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(DOUBLE, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, INT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, INT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -216,12 +216,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(FLOAT, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, INT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, INT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -250,12 +250,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(INT, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(INT, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(INT, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun),
binaryOperation(INT, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(INT, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(INT, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(INT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -293,12 +293,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(LONG, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(LONG, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(LONG, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun),
binaryOperation(LONG, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(LONG, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(LONG, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(LONG, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -339,12 +339,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(SHORT, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun),
binaryOperation(SHORT, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(SHORT, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(SHORT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -362,7 +362,7 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
class BigInteger(val value: String) {
fun add(o: BigInteger): BigInteger = o
fun divide(o: BigInteger): BigInteger = o
fun mod(o: BigInteger): BigInteger = o
fun rem(o: BigInteger): BigInteger = o
fun multiply(o: BigInteger): BigInteger = o
fun subtract(o: BigInteger): BigInteger = o
fun or(o: BigInteger): BigInteger = o
@@ -137,12 +137,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(BYTE, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(BYTE, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(BYTE, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(BYTE, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(BYTE, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(BYTE, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(BYTE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(BYTE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -179,12 +179,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(DOUBLE, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, INT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, LONG, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, SHORT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(DOUBLE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -216,12 +216,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(FLOAT, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, INT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, LONG, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, SHORT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(FLOAT, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(FLOAT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(FLOAT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -250,12 +250,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(INT, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(INT, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(INT, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun),
binaryOperation(INT, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(INT, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(INT, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(INT, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(INT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(INT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(INT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -293,12 +293,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(LONG, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(LONG, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(LONG, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun),
binaryOperation(LONG, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(LONG, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(LONG, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(LONG, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(LONG, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(LONG, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(LONG, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -339,12 +339,12 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
binaryOperation(SHORT, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }),
binaryOperation(SHORT, BYTE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, DOUBLE, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, emptyBinaryFun),
binaryOperation(SHORT, INT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, LONG, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, SHORT, "mod", { a, b -> a.<!DEPRECATION_ERROR!>mod<!>(b) }, { a, b -> a.mod(b) }),
binaryOperation(SHORT, BYTE, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, DOUBLE, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "rem", { a, b -> a.rem(b) }, emptyBinaryFun),
binaryOperation(SHORT, INT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, LONG, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, SHORT, "rem", { a, b -> a.rem(b) }, { a, b -> a.rem(b) }),
binaryOperation(SHORT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }),
binaryOperation(SHORT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun),
binaryOperation(SHORT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun),
@@ -362,7 +362,7 @@ private val binaryOperations: HashMap<BinaryOperationKey<*, *>, Pair<Function2<A
class BigInteger(val value: String) {
fun add(o: BigInteger): BigInteger = o
fun divide(o: BigInteger): BigInteger = o
fun mod(o: BigInteger): BigInteger = o
fun rem(o: BigInteger): BigInteger = o
fun multiply(o: BigInteger): BigInteger = o
fun subtract(o: BigInteger): BigInteger = o
fun or(o: BigInteger): BigInteger = o
@@ -25,9 +25,9 @@ public final class BigInteger {
public final fun divide(/*0*/ o: BigInteger): BigInteger
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final fun mod(/*0*/ o: BigInteger): BigInteger
public final fun multiply(/*0*/ o: BigInteger): BigInteger
public final fun or(/*0*/ o: BigInteger): BigInteger
public final fun rem(/*0*/ o: BigInteger): BigInteger
public final fun subtract(/*0*/ o: BigInteger): BigInteger
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final fun xor(/*0*/ o: BigInteger): BigInteger
-3
View File
@@ -72,9 +72,6 @@ val prop23 = -1.0 % 0
// val prop24: NaN.toDouble()
val prop24 = -0.0 % 0
// val prop25: NaN.toDouble()
val prop25 = 1.0.mod(0)
// val prop26: NaN.toDouble()
val prop26 = 1.0.rem(0)
@@ -76,36 +76,6 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ
FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:kotlin.Int [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:<unbound IrClassSymbolImpl> [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:<unbound IrClassSymbolImpl> [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:<unbound IrClassSymbolImpl> [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassSymbolImpl>) returnType:kotlin.Int [operator]
annotations:
<unbound>(1 = 'Use rem(other) instead', 2 = <unbound>(1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=<unbound IrClassSymbolImpl>)
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassSymbolImpl>
FUN IR_EXTERNAL_DECLARATION_STUB name:or visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
@@ -8,6 +8,6 @@ annotation class Ann(
val p5: Int
)
@Ann(1.plus(1), 1.minus(1), 1.times(1), 1.div(1), 1.mod(1)) class MyClass
@Ann(1.plus(1), 1.minus(1), 1.times(1), 1.div(1), 1.rem(1)) class MyClass
// EXPECTED: @Ann(p1 = 2, p2 = 0, p3 = 1, p4 = 1, p5 = 0)