diff --git a/compiler/testData/diagnostics/tests/evaluate/intOverflow.fir.kt b/compiler/testData/diagnostics/tests/evaluate/intOverflow.fir.kt index 741f62a305a..70a9db79b10 100644 --- a/compiler/testData/diagnostics/tests/evaluate/intOverflow.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/intOverflow.fir.kt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt b/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt index 43cd8710ec0..0d263a50315 100644 --- a/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt +++ b/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt @@ -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 } diff --git a/compiler/testData/diagnostics/tests/evaluate/intOverflow.txt b/compiler/testData/diagnostics/tests/evaluate/intOverflow.txt index a239e7c9809..14a001d2da6 100644 --- a/compiler/testData/diagnostics/tests/evaluate/intOverflow.txt +++ b/compiler/testData/diagnostics/tests/evaluate/intOverflow.txt @@ -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 diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt index 3133c5b29d7..04d6003ff41 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt @@ -19,11 +19,6 @@ fun test() { fooLong(1.div(1)) fooShort(1.div(1)) - fooInt(1.mod(1)) - fooByte(1.mod(1)) - fooLong(1.mod(1)) - fooShort(1.mod(1)) - fooInt(1.rem(1)) fooByte(1.rem(1)) fooLong(1.rem(1)) diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt index ee026d260b4..04d6003ff41 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt @@ -19,11 +19,6 @@ fun test() { fooLong(1.div(1)) fooShort(1.div(1)) - fooInt(1.mod(1)) - fooByte(1.mod(1)) - fooLong(1.mod(1)) - fooShort(1.mod(1)) - fooInt(1.rem(1)) fooByte(1.rem(1)) fooLong(1.rem(1)) diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt index 8a597af0b82..31771b3cc59 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt @@ -19,11 +19,6 @@ fun test() { fooLong(1 div 1) fooShort(1 div 1) - fooInt(1 mod 1) - fooByte(1 mod 1) - fooLong(1 mod 1) - fooShort(1 mod 1) - fooInt(1 rem 1) fooByte(1 rem 1) fooLong(1 rem 1) diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt index c1c45e05754..8c42ae04c06 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt @@ -19,11 +19,6 @@ fun test() { fooLong(1 div 1) fooShort(1 div 1) - fooInt(1 mod 1) - fooByte(1 mod 1) - fooLong(1 mod 1) - fooShort(1 mod 1) - fooInt(1 rem 1) fooByte(1 rem 1) fooLong(1 rem 1) diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.fir.kt index e122b400edd..3c7e9b95872 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.fir.kt @@ -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) // ------------------ diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt index fa1d758db87..ffa79e0fe1e 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt @@ -82,7 +82,6 @@ const val nonConstInitializer9 = 1.0/0.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) // ------------------ diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt index bcfd7b2c6d0..a53abcbf7fa 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt @@ -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 diff --git a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.fir.kt index f7f2fb9f75c..02944e2ca7a 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.fir.kt @@ -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) diff --git a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt index f5f794354b5..cf5f26ff6cb 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt @@ -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) diff --git a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.txt b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.txt index 630c7b89902..1896afbb001 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.txt +++ b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.txt @@ -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 diff --git a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.fir.kt b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.fir.kt index 8b8327f0836..e3eca658b92 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.fir.kt @@ -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 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt index b92ed64b842..dbcf2933ddf 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt @@ -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) - b % s - 1.0 % 2.0 + var a = 1 % 2 + var d = 5 + d %= 3 + b % s + 1.0 % 2.0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.txt b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.txt index 793301cae5a..854157cf360 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.txt +++ b/compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.txt @@ -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 { diff --git a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.fir.kt index 3816b2688dd..4696568f035 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.fir.kt @@ -137,12 +137,12 @@ private val binaryOperations: HashMap, Pair 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, Pair 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, Pair 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, Pair 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, Pair 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, Pair 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, Pair, Pair 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, Pair 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, Pair 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, Pair 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, Pair 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, Pair 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, Pair ($this:kotlin.Int, other:) returnType:kotlin.Int [operator] $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: - FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:) returnType:kotlin.Int [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int - VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: - FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:) returnType: [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int - VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: - FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:) returnType: [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int - VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: - FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: 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:) returnType: [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int - VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: - FUN IR_EXTERNAL_DECLARATION_STUB name:mod visibility:public modality:FINAL <> ($this:kotlin.Int, other:) returnType:kotlin.Int [operator] - annotations: - (1 = 'Use rem(other) instead', 2 = (1 = 'rem(other)', 2 = []), 3 = GET_ENUM 'UNBOUND IrEnumEntrySymbolImpl' type=) - $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int - VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type: 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: type:kotlin.Int VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt b/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt index 8bd9a032e7e..7f990396ef5 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt @@ -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)