Inspectopedia Help

Redundant call to 'toString()' in string template

Reports calls to toString() in string templates that can be safely removed.

Example:

fun foo(a: Int, b: Int) = a + b fun test(): String { return "Foo: ${foo(0, 4).toString()}" // 'toString()' is redundant }

After the quick-fix is applied:

fun foo(a: Int, b: Int) = a + b fun test(): String { return "Foo: ${foo(0, 4)}" }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023