diff --git a/runtime/src/main/kotlin/kotlin/text/StringBuilderNative.kt b/runtime/src/main/kotlin/kotlin/text/StringBuilderNative.kt index 55fcc40104f..f73b1c2f7f9 100644 --- a/runtime/src/main/kotlin/kotlin/text/StringBuilderNative.kt +++ b/runtime/src/main/kotlin/kotlin/text/StringBuilderNative.kt @@ -5,14 +5,63 @@ package kotlin.text -fun StringBuilder.appendln(it: String) = append(it).appendln() -fun StringBuilder.appendln(it: Boolean) = append(it).appendln() -fun StringBuilder.appendln(it: Byte) = append(it).appendln() -fun StringBuilder.appendln(it: Short) = append(it).appendln() -fun StringBuilder.appendln(it: Int) = append(it).appendln() -fun StringBuilder.appendln(it: Long) = append(it).appendln() -fun StringBuilder.appendln(it: Float) = append(it).appendln() -fun StringBuilder.appendln(it: Double) = append(it).appendln() -fun StringBuilder.appendln(it: Any?) = append(it).appendln() +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Byte): StringBuilder = append(value).appendLine() -fun StringBuilder.appendln() = append('\n') +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Short): StringBuilder = append(value).appendLine() + +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Int): StringBuilder = append(value).appendLine() + +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Long): StringBuilder = append(value).appendLine() + +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Float): StringBuilder = append(value).appendLine() + +/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */ +@SinceKotlin("1.4") +@kotlin.internal.InlineOnly +public inline fun StringBuilder.appendLine(value: Double): StringBuilder = append(value).appendLine() + + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: String): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Boolean): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Byte): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Short): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Int): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Long): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Float): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Double): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(it: Any?): StringBuilder = appendLine(it) + +@Deprecated("Use appendLine instead", ReplaceWith("appendLine()"), level = DeprecationLevel.WARNING) +public fun StringBuilder.appendln(): StringBuilder = appendLine() \ No newline at end of file