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 58309fa6d85..6a4ef2cc7da 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 @@ -130,12 +130,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(BYTE, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(BYTE, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(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, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(BYTE, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), @@ -178,12 +172,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, SHORT, "minus", { a, b -> a.minus(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, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), @@ -221,12 +209,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "minus", { a, b -> a.minus(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, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), @@ -265,12 +247,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(INT, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(INT, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(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, INT, "or", { a, b -> a.or(b) }, { a, b -> a.or(b) }), binaryOperation(INT, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(INT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), @@ -314,12 +290,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(LONG, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(LONG, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(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, LONG, "or", { a, b -> a.or(b) }, { a, b -> a.or(b) }), binaryOperation(LONG, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(LONG, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), @@ -362,12 +332,6 @@ internal val binaryOperations: HashMap, Pair a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(SHORT, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(SHORT, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(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, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(SHORT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), diff --git a/core/builtins/native/kotlin/Primitives.kt b/core/builtins/native/kotlin/Primitives.kt index 84d300efaae..1234526cc22 100644 --- a/core/builtins/native/kotlin/Primitives.kt +++ b/core/builtins/native/kotlin/Primitives.kt @@ -130,25 +130,6 @@ public class Byte private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -361,25 +342,6 @@ public class Short private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -590,25 +552,6 @@ public class Int private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -838,25 +781,6 @@ public class Long private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Long @@ -1091,25 +1015,6 @@ public class Float private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Float @@ -1311,25 +1216,6 @@ public class Double private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Double diff --git a/generators/builtins/primitives.kt b/generators/builtins/primitives.kt index dd71f1533a3..247acc35252 100644 --- a/generators/builtins/primitives.kt +++ b/generators/builtins/primitives.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -16,7 +16,6 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { "minus" to "Subtracts the other value from this value.", "times" to "Multiplies this value by the other value.", "div" to "Divides this value by the other value.", - "mod" to "Calculates the remainder of dividing this value by the other value.", "rem" to "Calculates the remainder of dividing this value by the other value." ) internal val unaryOperators: Map = mapOf( @@ -172,9 +171,6 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { when (name) { "rem" -> out.println(" @SinceKotlin(\"1.1\")") - - "mod" -> - 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/builtins/unsignedTypes.kt b/generators/builtins/unsignedTypes.kt index a2351fdc2f7..35c731e18a1 100644 --- a/generators/builtins/unsignedTypes.kt +++ b/generators/builtins/unsignedTypes.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -124,9 +124,7 @@ class UnsignedTypeGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIns private fun generateBinaryOperators() { for ((name, doc) in GeneratePrimitives.binaryOperators) { - if (name != "mod") { - generateOperator(name, doc) - } + generateOperator(name, doc) } } diff --git a/libraries/stdlib/js-ir/builtins/Primitives.kt b/libraries/stdlib/js-ir/builtins/Primitives.kt index 89f6fa9c87c..5904e6393fa 100644 --- a/libraries/stdlib/js-ir/builtins/Primitives.kt +++ b/libraries/stdlib/js-ir/builtins/Primitives.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -131,25 +131,6 @@ public class Byte private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -362,25 +343,6 @@ public class Short private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -591,25 +553,6 @@ public class Int private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int @@ -847,25 +790,6 @@ public class Float private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Float @@ -1072,25 +996,6 @@ public class Double private constructor() : Number(), Comparable { /** Divides this value by the other value. */ 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.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.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.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.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.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.ERROR) - public operator fun mod(other: Double): Double - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Double diff --git a/libraries/stdlib/js-ir/runtime/long.kt b/libraries/stdlib/js-ir/runtime/long.kt index c88d608c080..a0a39499c6c 100644 --- a/libraries/stdlib/js-ir/runtime/long.kt +++ b/libraries/stdlib/js-ir/runtime/long.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -151,30 +151,6 @@ public class Long internal constructor( /** Divides this value by the other value. */ public inline operator fun div(other: Double): Double = toDouble() / other - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Byte): Long = rem(other) - - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Short): Long = rem(other) - - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Int): Long = rem(other) - - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Long): Long = rem(other) - - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Float): Float = rem(other) - - /** Calculates the remainder of dividing this value by the other value. */ - @Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.WARNING) - public inline operator fun mod(other: Double): Double = rem(other) - /** Calculates the remainder of dividing this value by the other value. */ @SinceKotlin("1.1") public inline operator fun rem(other: Byte): Long = rem(other.toLong()) diff --git a/libraries/stdlib/jvm/src/kotlin/util/BigDecimals.kt b/libraries/stdlib/jvm/src/kotlin/util/BigDecimals.kt index 93b95080038..17450aa6c19 100644 --- a/libraries/stdlib/jvm/src/kotlin/util/BigDecimals.kt +++ b/libraries/stdlib/jvm/src/kotlin/util/BigDecimals.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -39,13 +39,6 @@ public inline operator fun BigDecimal.times(other: BigDecimal): BigDecimal = thi @kotlin.internal.InlineOnly public inline operator fun BigDecimal.div(other: BigDecimal): BigDecimal = this.divide(other, RoundingMode.HALF_EVEN) -/** - * Enables the use of the `%` operator for [BigDecimal] instances. - */ -@kotlin.internal.InlineOnly -@Deprecated("Use rem(other) instead", ReplaceWith("rem(other)"), DeprecationLevel.ERROR) -public inline operator fun BigDecimal.mod(other: BigDecimal): BigDecimal = this.remainder(other) - /** * Enables the use of the `%` operator for [BigDecimal] instances. */ diff --git a/libraries/stdlib/jvm/test/numbers/BigNumbersTest.kt b/libraries/stdlib/jvm/test/numbers/BigNumbersTest.kt index c6bcc17f9f8..8096f396e2f 100644 --- a/libraries/stdlib/jvm/test/numbers/BigNumbersTest.kt +++ b/libraries/stdlib/jvm/test/numbers/BigNumbersTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -72,7 +72,6 @@ class BigNumbersTest { assertEquals(BigDecimal("2"), BigDecimal("4") / a) assertEquals(BigDecimal("-2"), -a) assertEquals(BigDecimal("-2"), -a % b) - assertEquals(BigDecimal("-2"), @Suppress("DEPRECATION_ERROR") (-a).mod(b)) assertEquals(BigDecimal("-2"), (-a).rem(b)) assertEquals(BigDecimal("3"), a.inc())