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:
@@ -85,7 +85,7 @@ class CharValue(value: Char) : IntegerValueConstant<Char>(value) {
|
||||
|
||||
override fun <R, D> accept(visitor: AnnotationArgumentVisitor<R, D>, data: D) = visitor.visitCharValue(this, data)
|
||||
|
||||
override fun toString() = "\\u%04X ('%s')".format(value.toInt(), getPrintablePart(value))
|
||||
override fun toString() = "\\u%04X ('%s')".format(value.code, getPrintablePart(value))
|
||||
|
||||
private fun getPrintablePart(c: Char): String = when (c) {
|
||||
'\b' -> "\\b"
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ class AnnotationDeserializer(private val module: ModuleDescriptor, private val n
|
||||
|
||||
return when (value.type) {
|
||||
Type.BYTE -> value.intValue.toByte().letIf(isUnsigned, ::UByteValue, ::ByteValue)
|
||||
Type.CHAR -> CharValue(value.intValue.toChar())
|
||||
Type.CHAR -> CharValue(value.intValue.toInt().toChar())
|
||||
Type.SHORT -> value.intValue.toShort().letIf(isUnsigned, ::UShortValue, ::ShortValue)
|
||||
Type.INT -> value.intValue.toInt().letIf(isUnsigned, ::UIntValue, ::IntValue)
|
||||
Type.LONG -> value.intValue.letIf(isUnsigned, ::ULongValue, ::LongValue)
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ fun stringsToBytes(strings: Array<String>): ByteArray {
|
||||
var i = 0
|
||||
for (s in strings) {
|
||||
for (si in 0..s.length - 1) {
|
||||
result[i++] = s[si].toByte()
|
||||
result[i++] = s[si].code.toByte()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user