Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
This commit is contained in:
@@ -7,6 +7,5 @@ import kotlin.reflect.jvm.isAccessible
|
|||||||
fun doStuff(fn: KFunction1<String, String>) = fn.call("oK")
|
fun doStuff(fn: KFunction1<String, String>) = fn.call("oK")
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val method: KFunction1<String, String> = String::capitalize
|
return doStuff(String::capitalize.apply { isAccessible = true })
|
||||||
return doStuff(method.apply { isAccessible = true })
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -574,6 +574,7 @@ public actual fun String.capitalize(): String {
|
|||||||
*/
|
*/
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalStdlibApi
|
||||||
|
@kotlin.internal.LowPriorityInOverloadResolution
|
||||||
public fun String.capitalize(locale: Locale): String {
|
public fun String.capitalize(locale: Locale): String {
|
||||||
if (isNotEmpty()) {
|
if (isNotEmpty()) {
|
||||||
val firstChar = this[0]
|
val firstChar = this[0]
|
||||||
@@ -608,6 +609,7 @@ public actual fun String.decapitalize(): String {
|
|||||||
*/
|
*/
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalStdlibApi
|
||||||
|
@kotlin.internal.LowPriorityInOverloadResolution
|
||||||
public fun String.decapitalize(locale: Locale): String {
|
public fun String.decapitalize(locale: Locale): String {
|
||||||
return if (isNotEmpty() && !this[0].isLowerCase()) substring(0, 1).toLowerCase(locale) + substring(1) else this
|
return if (isNotEmpty() && !this[0].isLowerCase()) substring(0, 1).toLowerCase(locale) + substring(1) else this
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user