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:
@@ -988,7 +988,7 @@ object Elements : TemplateGroupBase() {
|
||||
specialFor(RangesOfPrimitives) {
|
||||
body {
|
||||
val expr = when (primitive) {
|
||||
PrimitiveType.Char -> "nextInt(first.toInt(), last.toInt() + 1).toChar()"
|
||||
PrimitiveType.Char -> "nextInt(first.code, last.code + 1).toChar()"
|
||||
else -> "next$primitive(this)"
|
||||
}
|
||||
"""
|
||||
@@ -1033,7 +1033,7 @@ object Elements : TemplateGroupBase() {
|
||||
specialFor(RangesOfPrimitives) {
|
||||
body {
|
||||
val expr = when (primitive) {
|
||||
PrimitiveType.Char -> "nextInt(first.toInt(), last.toInt() + 1).toChar()"
|
||||
PrimitiveType.Char -> "nextInt(first.code, last.code + 1).toChar()"
|
||||
else -> "next$primitive(this)"
|
||||
}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user