String.compareTo: SinceKotlin in JS and common, restore default parameter value in JVM

Default parameter is required to generate docs with Dokka for now.

#KT-18067
This commit is contained in:
Ilya Gorbunov
2018-08-12 03:18:19 +03:00
parent f05a19aafb
commit 27dde5f730
3 changed files with 12 additions and 7 deletions
@@ -317,7 +317,8 @@ public inline fun String.codePointCount(beginIndex: Int, endIndex: Int): Int =
/**
* Compares two strings lexicographically, optionally ignoring case differences.
*/
public actual fun String.compareTo(other: String, ignoreCase: Boolean): Int {
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
public actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int {
if (ignoreCase)
return (this as java.lang.String).compareToIgnoreCase(other)
else