Highlight use of toString() inside string interpolation as redundant #KT-10731 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
52dacd1d49
commit
d68a681db5
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.RemoveToStringInStringTemplateInspection
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
operator fun Any.invoke() = this
|
||||
|
||||
fun foo(arg: Any) = "${arg().<caret>toString()}"
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
operator fun Any.invoke() = this
|
||||
|
||||
fun foo(arg: Any) = "${arg()}"
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(arg: Any) = "arg = ${arg.<caret>toString()}"
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(arg: Any) = "arg = $arg"
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(arg: Any) = "arg = ${arg.<caret>toString()}xy"
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(arg: Any) = "arg = ${arg}xy"
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(s: String) = s
|
||||
|
||||
fun bar() = foo("a${"b".toString()<caret>}")
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Remove 'toString()' call" "true"
|
||||
|
||||
fun foo(s: String) = s
|
||||
|
||||
fun bar() = foo("a${"b"<caret>}")
|
||||
Reference in New Issue
Block a user