Migrate deprecations in core, compiler, idea, tests

Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
This commit is contained in:
Ilya Gorbunov
2021-04-06 18:58:25 +03:00
parent b64b96eee6
commit e450a6494a
30 changed files with 35 additions and 34 deletions
@@ -35,7 +35,7 @@ internal object FirAnnotationArgumentVisitor : AnnotationArgumentVisitor<Unit, F
override fun visitCharValue(value: CharValue, data: FirAnnotationArgumentVisitorData) {
data.builder.type = ProtoBuf.Annotation.Argument.Value.Type.CHAR
data.builder.intValue = value.value.toLong()
data.builder.intValue = value.value.code.toLong()
}
override fun visitDoubleValue(value: DoubleValue, data: FirAnnotationArgumentVisitorData) {
@@ -53,7 +53,7 @@ internal class ByteValue(value: Byte) : IntegerValueConstant<Byte>(value) {
internal class CharValue(value: Char) : IntegerValueConstant<Char>(value) {
override fun <R, D> accept(visitor: AnnotationArgumentVisitor<R, D>, data: D): R = visitor.visitCharValue(this, data)
override fun toString(): String = "\\u%04X ('%s')".format(value.toInt(), getPrintablePart(value))
override fun toString(): String = "\\u%04X ('%s')".format(value.code, getPrintablePart(value))
private fun getPrintablePart(c: Char): String = when (c) {
'\b' -> "\\b"