Deprecate Double, Float and Comparable range implementations.
This commit is contained in:
@@ -57,11 +57,11 @@ class ${t}ProgressionIterator(start: $t, end: $t, val increment: $incrementType)
|
||||
|
||||
fun floatingPointProgressionIterator(kind: ProgressionKind): String {
|
||||
val t = kind.capitalized
|
||||
|
||||
return """/**
|
||||
* An iterator over a progression of values of type `$t`.
|
||||
* @property increment the number by which the value is incremented on each step.
|
||||
*/
|
||||
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
|
||||
class ${t}ProgressionIterator(start: $t, val end: $t, val increment: $t) : ${t}Iterator() {
|
||||
private var next = start
|
||||
|
||||
|
||||
@@ -64,6 +64,11 @@ class GenerateProgressions(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
" }"
|
||||
}
|
||||
|
||||
if (kind == FLOAT || kind == DOUBLE) {
|
||||
out.println("""@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)""")
|
||||
out.println("""@Suppress("DEPRECATION_ERROR")""")
|
||||
}
|
||||
|
||||
out.println(
|
||||
"""/**
|
||||
* A progression of values of type `$t`.
|
||||
|
||||
@@ -64,6 +64,11 @@ class GenerateRanges(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
|
||||
val toString = "\"\$start..\$end\""
|
||||
|
||||
if (kind == FLOAT || kind == DOUBLE) {
|
||||
out.println("""@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)""")
|
||||
out.println("""@Suppress("DEPRECATION_ERROR")""")
|
||||
}
|
||||
|
||||
out.println(
|
||||
"""/**
|
||||
* A range of values of type `$t`.
|
||||
|
||||
Reference in New Issue
Block a user