Drop Ranges, Progressions, ProgressionIterators for Double and Float.

Undeprecate generic Comparable.rangeTo, but return private implementation instead.
Undeprecate contains and coerceIn for generic ranges.
This commit is contained in:
Ilya Gorbunov
2015-11-06 18:22:31 +03:00
parent 4d2f9b82da
commit 6bac3e1986
54 changed files with 30 additions and 1630 deletions
@@ -123,6 +123,8 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) {
val returnType =
maxByDomainCapacity(thisKind, otherKind)
.let { if (it == PrimitiveType.CHAR) it else maxByDomainCapacity(it, PrimitiveType.INT) }
if (returnType == PrimitiveType.DOUBLE || returnType == PrimitiveType.FLOAT)
continue
out.println(" /** Creates a range from this value to the specified [other] value. */")
out.println(" public operator fun rangeTo(other: ${otherKind.capitalized}): ${returnType.capitalized}Range")
}
@@ -84,7 +84,7 @@ class GenerateProgressionIterators(out: PrintWriter) : BuiltInsSourceGenerator(o
out.println(integerProgressionIterator(kind))
}
else {
out.println(floatingPointProgressionIterator(kind))
continue
}
out.println()
}
@@ -184,7 +184,7 @@ public open class $progression(
override fun generateBody() {
for (kind in ProgressionKind.values) {
if (kind == FLOAT || kind == DOUBLE)
generateFloatingPointBody(kind)
continue
else
generateDiscreteBody(kind)
}
@@ -65,8 +65,7 @@ class GenerateRanges(out: PrintWriter) : BuiltInsSourceGenerator(out) {
val toString = "\"\$start..\$endInclusive\""
if (kind == FLOAT || kind == DOUBLE) {
out.println("""@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.WARNING)""")
out.println("""@Suppress("DEPRECATION_ERROR")""")
continue
}
if (kind == SHORT || kind == BYTE) {
out.println("""@Deprecated("Use IntRange instead.", ReplaceWith("IntRange"), level = DeprecationLevel.WARNING)""")