Deprecate Char-to-Number conversions in stdlib (JVM and JS)
- Int.toChar was left non-deprecated because the replacement is not intrinsic yet. - Number.toChar was left non-deprecated because otherwise the deprecation propagates to the override, Int.toChar. KT-23451
This commit is contained in:
@@ -27,7 +27,7 @@ fun integerProgressionIterator(kind: ProgressionKind): String {
|
||||
val incrementType = progressionIncrementType(kind)
|
||||
|
||||
val (toInt, toType) = when (kind) {
|
||||
CHAR -> ".toInt()" to ".to$t()"
|
||||
CHAR -> ".code" to ".toChar()"
|
||||
else -> "" to ""
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ fun integerProgressionIterator(kind: ProgressionKind): String {
|
||||
* @property step the number by which the value is incremented on each step.
|
||||
*/
|
||||
internal class ${t}ProgressionIterator(first: $t, last: $t, val step: $incrementType) : ${t}Iterator() {
|
||||
private val finalElement = last$toInt
|
||||
private val finalElement: $incrementType = last$toInt
|
||||
private var hasNext: Boolean = if (step > 0) first <= last else first >= last
|
||||
private var next = if (hasNext) first$toInt else finalElement
|
||||
private var next: $incrementType = if (hasNext) first$toInt else finalElement
|
||||
|
||||
override fun hasNext(): Boolean = hasNext
|
||||
|
||||
|
||||
Reference in New Issue
Block a user