Deprecate meaningless or vague-defined operations with Char operands: downTo.
This commit is contained in:
@@ -31,15 +31,21 @@ private fun generateDownTos(outputFile: File, header: String) {
|
||||
else -> "-1"
|
||||
}
|
||||
|
||||
val deprecated =
|
||||
if ((fromType == "Char") != (toType == "Char")) {
|
||||
"""deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.")"""
|
||||
} else ""
|
||||
|
||||
writer.println("""
|
||||
/**
|
||||
* Returns a progression from this value down to the specified [to] value.
|
||||
*
|
||||
* The [to] value has to be less than this value.
|
||||
*/
|
||||
$deprecated
|
||||
public fun $fromType.downTo(to: $toType): $progressionType {
|
||||
return $progressionType($fromExpr, $toExpr, $incrementExpr)
|
||||
}""")
|
||||
}""".replace("\n\n","\n"))
|
||||
}
|
||||
|
||||
println("Writing $outputFile")
|
||||
@@ -53,7 +59,7 @@ public fun $fromType.downTo(to: $toType): $progressionType {
|
||||
$COMMON_AUTOGENERATED_WARNING
|
||||
""")
|
||||
|
||||
val types = array("Byte", "Char", "Short", "Int", "Long", "Float", "Double")
|
||||
val types = arrayOf("Byte", "Char", "Short", "Int", "Long", "Float", "Double")
|
||||
for (fromType in types) {
|
||||
for (toType in types) {
|
||||
generateDownTo(writer, fromType, toType)
|
||||
|
||||
Reference in New Issue
Block a user