Minor, fix warnings on new stdlib API
In modules where allWarningsAsErrors is not yet enabled.
This commit is contained in:
@@ -37,7 +37,7 @@ fun ProtoBuf.Annotation.Argument.Value.readAnnotationArgument(strings: NameResol
|
||||
|
||||
return when (type) {
|
||||
BYTE -> KmAnnotationArgument.ByteValue(intValue.toByte())
|
||||
CHAR -> KmAnnotationArgument.CharValue(intValue.toChar())
|
||||
CHAR -> KmAnnotationArgument.CharValue(intValue.toInt().toChar())
|
||||
SHORT -> KmAnnotationArgument.ShortValue(intValue.toShort())
|
||||
INT -> KmAnnotationArgument.IntValue(intValue.toInt())
|
||||
LONG -> KmAnnotationArgument.LongValue(intValue)
|
||||
|
||||
@@ -34,7 +34,7 @@ fun KmAnnotationArgument.writeAnnotationArgument(strings: StringTable): ProtoBuf
|
||||
}
|
||||
is KmAnnotationArgument.CharValue -> {
|
||||
this.type = ProtoBuf.Annotation.Argument.Value.Type.CHAR
|
||||
this.intValue = value.toLong()
|
||||
this.intValue = value.code.toLong()
|
||||
}
|
||||
is KmAnnotationArgument.ShortValue -> {
|
||||
this.type = ProtoBuf.Annotation.Argument.Value.Type.SHORT
|
||||
|
||||
@@ -85,7 +85,7 @@ public actual fun CharSequence.regionMatches(thisOffset: Int, other: CharSequenc
|
||||
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.5")
|
||||
public actual fun String.capitalize(): String {
|
||||
return if (isNotEmpty()) substring(0, 1).toUpperCase() + substring(1) else this
|
||||
return if (isNotEmpty()) substring(0, 1).uppercase() + substring(1) else this
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public actual fun String.capitalize(): String {
|
||||
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { it.lowercase() }"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.5")
|
||||
public actual fun String.decapitalize(): String {
|
||||
return if (isNotEmpty()) substring(0, 1).toLowerCase() + substring(1) else this
|
||||
return if (isNotEmpty()) substring(0, 1).lowercase() + substring(1) else this
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -122,7 +122,7 @@ public class SequenceTest {
|
||||
data.forEach { }
|
||||
assertEquals(0, count, "onEach should be executed only when resulting sequence is iterated")
|
||||
|
||||
val sum = newData.sumBy { it.length }
|
||||
val sum = newData.sumOf { it.length }
|
||||
assertEquals(sum, count)
|
||||
}
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ private fun String.sanitize(quote: Char): String =
|
||||
'\r' -> append("\\r")
|
||||
'\t' -> append("\\t")
|
||||
quote -> append("\\").append(quote)
|
||||
else -> append(if (c.isISOControl()) "\\u%04x".format(c.toInt()) else c)
|
||||
else -> append(if (c.isISOControl()) "\\u%04x".format(c.code) else c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user