Finally drop deprecated mod functions from numeric types
#KT-26654
This commit is contained in:
@@ -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<String, String> = 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}")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user