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:
+1
-1
@@ -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))
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user