diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt index 1f31d8c18b9..8d4a5c24b13 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt @@ -14,6 +14,8 @@ * limitations under the License. */ +@file:Suppress("DEPRECATION_ERROR") + package org.jetbrains.kotlin.resolve.constants.evaluate import java.math.BigInteger diff --git a/compiler/testData/codegen/box/evaluate/simpleCallBinary.kt b/compiler/testData/codegen/box/evaluate/simpleCallBinary.kt index f6f4e1946ad..cba5e152f5e 100644 --- a/compiler/testData/codegen/box/evaluate/simpleCallBinary.kt +++ b/compiler/testData/codegen/box/evaluate/simpleCallBinary.kt @@ -17,7 +17,7 @@ const val prop1: Int = 1.plus(1) const val prop2: Int = 1.minus(1) const val prop3: Int = 1.times(1) const val prop4: Int = 1.div(1) -const val prop5: Int = 1.mod(1) +const val prop5: Int = 1.rem(1) @Ann(prop1, prop2, prop3, prop4, prop5) class MyClass diff --git a/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt b/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt index 644f89088a6..2143593aaa6 100644 --- a/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt +++ b/compiler/testData/diagnostics/tests/evaluate/intOverflow.kt @@ -21,7 +21,7 @@ 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 l24: Int = (-1).mod(5) val l25: Int = (-1).rem(5) val l26: Int = (-1) % 5 @@ -45,7 +45,7 @@ fun foo() { val l21: Int = intMinValue - intMinValue val l22: Int = intMinValue + -intMinValue val l23: Int = intMaxValue + -intMinValue - val l24: Int = (-1).mod(5) + val l24: Int = (-1).mod(5) val l25: Int = (-1).rem(5) val l26: Int = (-1) % 5 } @@ -70,7 +70,7 @@ class A { val l21: Int = intMinValue - intMinValue val l22: Int = intMinValue + -intMinValue val l23: Int = intMaxValue + -intMinValue - val l24: Int = (-1).mod(5) +ยง 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/numberBinaryOperationsCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt index 5efda582960..ee026d260b4 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt @@ -19,10 +19,10 @@ 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.mod(1)) + fooByte(1.mod(1)) + fooLong(1.mod(1)) + fooShort(1.mod(1)) fooInt(1.rem(1)) fooByte(1.rem(1)) diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt index 75b889b8862..c1c45e05754 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.kt @@ -19,10 +19,10 @@ 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 mod 1) + fooByte(1 mod 1) + fooLong(1 mod 1) + fooShort(1 mod 1) fooInt(1 rem 1) fooByte(1 rem 1) diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt index af3ab9cfbed..d8cb2f991ea 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt @@ -82,7 +82,7 @@ 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 nonConstInitializer13 = 0.mod(0) const val nonConstInitializer14 = 0.rem(0) const val nonConstInitializer15 = 0.div(0) @@ -99,7 +99,7 @@ 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 constInitializer14 = 1.0.mod(0) const val constInitializer15 = 1.0.div(0) // ------------------ diff --git a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt index 94a073c6eff..f5f794354b5 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/noDivisionByZeroFeature.kt @@ -6,7 +6,7 @@ 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 f = 0.0.mod(0) const val g = 0.0.rem(0) const val h = 0.0.div(0) @@ -16,6 +16,6 @@ val nonConst1 = 1.0 / 0 val nonConst2 = 1 / 0 val nonConst3 = 1.0 % 0 val nonConst4 = 1 % 0 -val nonConst5 = 1.mod(0) +val nonConst5 = 1.mod(0) val nonConst6 = 1.rem(0) val nonConst7 = 1.div(0) diff --git a/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.kt b/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.kt new file mode 100644 index 00000000000..d6b8e8630eb --- /dev/null +++ b/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.kt @@ -0,0 +1,3 @@ +fun test() { + 1.mod(3) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.txt b/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.txt new file mode 100644 index 00000000000..93e27f34c8c --- /dev/null +++ b/compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.txt @@ -0,0 +1,3 @@ +package + +public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt index 05114af9b8a..448b1c1b126 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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), diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 5ddf4e1d261..59ef953ee60 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -14057,6 +14057,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { runTest("compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt"); } + @TestMetadata("errorOnExplicitModCall.kt") + public void testErrorOnExplicitModCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.kt"); + } + @TestMetadata("forbiddenModOperatorConvention.kt") public void testForbiddenModOperatorConvention() throws Exception { runTest("compiler/testData/diagnostics/tests/operatorRem/forbiddenModOperatorConvention.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index be9492537b6..be79aa85ce6 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -14057,6 +14057,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt"); } + @TestMetadata("errorOnExplicitModCall.kt") + public void testErrorOnExplicitModCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/operatorRem/errorOnExplicitModCall.kt"); + } + @TestMetadata("forbiddenModOperatorConvention.kt") public void testForbiddenModOperatorConvention() throws Exception { runTest("compiler/testData/diagnostics/tests/operatorRem/forbiddenModOperatorConvention.kt"); diff --git a/core/builtins/native/kotlin/Primitives.kt b/core/builtins/native/kotlin/Primitives.kt index fd094107a7e..64e628b7ad9 100644 --- a/core/builtins/native/kotlin/Primitives.kt +++ b/core/builtins/native/kotlin/Primitives.kt @@ -131,22 +131,22 @@ public class Byte private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ @@ -319,22 +319,22 @@ public class Short private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ @@ -507,22 +507,22 @@ public class Int private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ @@ -710,22 +710,22 @@ public class Long private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ @@ -916,22 +916,22 @@ public class Float private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ @@ -1099,22 +1099,22 @@ public class Double private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Byte): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Short): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Int): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Long): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Float): Double /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) + @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) public operator fun mod(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ diff --git a/generators/builtins/primitives.kt b/generators/builtins/primitives.kt index ddcb9c0db71..0dac7819999 100644 --- a/generators/builtins/primitives.kt +++ b/generators/builtins/primitives.kt @@ -174,7 +174,7 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { out.println(" @SinceKotlin(\"1.1\")") "mod" -> - out.println(" @Deprecated(\"Use rem(other) instead\", ReplaceWith(\"rem(other)\"), DeprecationLevel.WARNING)") + out.println(" @Deprecated(\"Use rem(other) instead\", ReplaceWith(\"rem(other)\"), DeprecationLevel.ERROR)") } out.println(" public operator fun $name(other: ${otherKind.capitalized}): ${returnType.capitalized}") } diff --git a/generators/tests/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt b/generators/tests/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt index 28c377051fa..a5f513756d7 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt @@ -38,6 +38,8 @@ fun generate(): String { val sb = StringBuilder() val p = Printer(sb) p.println(File("license/LICENSE.txt").readText()) + p.println("@file:Suppress(\"DEPRECATION_ERROR\")") + p.println() p.println("package org.jetbrains.kotlin.resolve.constants.evaluate") p.println() p.println("import java.math.BigInteger")