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
@@ -243,7 +243,7 @@ abstract class AbstractAnnotationDeserializer(
const(kind, value.intValue)
}
CHAR -> const(ConstantValueKind.Char, value.intValue.toChar())
CHAR -> const(ConstantValueKind.Char, value.intValue.toInt().toChar())
FLOAT -> const(ConstantValueKind.Float, value.floatValue)
DOUBLE -> const(ConstantValueKind.Double, value.doubleValue)
BOOLEAN -> const(ConstantValueKind.Boolean, (value.intValue != 0L))
@@ -54,7 +54,7 @@ class FirConstDeserializer(
): FirExpression? {
return when (constKind) {
"BYTE", "B" -> buildConstExpression(null, ConstantValueKind.Byte, ((protoValue?.intValue ?: sourceValue) as Number).toByte())
"CHAR", "C" -> buildConstExpression(null, ConstantValueKind.Char, ((protoValue?.intValue ?: sourceValue) as Number).toChar())
"CHAR", "C" -> buildConstExpression(null, ConstantValueKind.Char, ((protoValue?.intValue ?: sourceValue) as Number).toInt().toChar())
"SHORT", "S" -> buildConstExpression(null, ConstantValueKind.Short, ((protoValue?.intValue ?: sourceValue) as Number).toShort())
"INT", "I" -> buildConstExpression(null, ConstantValueKind.Int, protoValue?.intValue?.toInt() ?: sourceValue as Int)
"LONG", "J" -> buildConstExpression(null, ConstantValueKind.Long, protoValue?.intValue ?: sourceValue as Long)