Deprecate String.concat with error severity.
Fix concat j2k conversion. Add expected deprecation errors for Java String constructors that must be converted to special Kotlin String methods.
This commit is contained in:
@@ -105,7 +105,7 @@ private fun String.indentWidth(): Int = indexOfFirst { !it.isWhitespace() }.let
|
||||
|
||||
private fun getIndentFunction(indent: String) = when {
|
||||
indent.isEmpty() -> { line: String -> line }
|
||||
else -> { line: String -> indent.concat(line) }
|
||||
else -> { line: String -> indent + line }
|
||||
}
|
||||
|
||||
private inline fun List<String>.reindent(resultSizeEstimate: Int, indentAddFunction: (String) -> String, indentCutFunction: (String) -> String?): String {
|
||||
|
||||
@@ -277,7 +277,7 @@ public fun String.compareTo(other: String, ignoreCase: Boolean = false): Int {
|
||||
/**
|
||||
* Returns a new string obtained by concatenating this string and the specified string.
|
||||
*/
|
||||
// TODO: Deprecated in favor of operator plus, when it would be as efficient as concat
|
||||
@Deprecated("Use this + other, eventually it will be optimized as concat.", ReplaceWith("this + other"), level = DeprecationLevel.ERROR)
|
||||
public fun String.concat(other: String): String = (this as java.lang.String).concat(other)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user