Deprecate Double, Float and Comparable range implementations.

This commit is contained in:
Ilya Gorbunov
2015-10-13 20:38:15 +03:00
parent aeb4abe39d
commit 69dc6701cc
15 changed files with 279 additions and 94 deletions
@@ -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`.