Files
kotlin-fork/idea/testData/inspectionsLocal/replaceStringFormatWithLiteral/formattableArgs.kt
T
Toshiaki Kameyama 6675d7814c KT-14779 Inspection to replace String.format with string templates (#1645)
* Add inspection to replace String.format with string templates #KT-14779 Fixed

* KT-14779 Fixed
2018-06-20 16:23:04 +03:00

17 lines
370 B
Kotlin
Vendored

// PROBLEM: none
// RUNTIME_WITH_FULL_JDK
import java.util.*
fun test() {
val foo = Foo(1)
val bar = 2
<caret>String.format("foo is %s, bar is %s.", foo, bar)
}
class Foo(private val value: Int) : Formattable {
override fun formatTo(formatter: Formatter?, flags: Int, width: Int, precision: Int) {
formatter?.out()?.append("[$value]")
}
}