Implement "Remove redundant '.let' call" binary operator support #KT-14396 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
ce72337ebd
commit
a662d777e8
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun baz(foo: String) {
|
||||
foo.let<caret> { it.indexOfLast { c -> c == it[0] } + 1 }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun baz(foo: String) {
|
||||
foo.let<caret> { it.length + "".indexOfLast { c -> c == it[0] } }
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
"".let<caret> { it.length + "".indexOf(it) }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
"".let<caret> { it.length + it.length }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
"".let<caret> { it.substring(0, 1) + it }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun foo() {
|
||||
"".let<caret> { it.length + 1 }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun foo() {
|
||||
"".length + 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun foo() {
|
||||
"".let<caret> { it + 1 }
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun foo() {
|
||||
"" + 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun Int.foo() {
|
||||
let<caret> { it.dec() + 1 }
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun Int.foo() {
|
||||
dec() + 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun Int.foo() {
|
||||
let<caret> { it + 1 }
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
fun Int.foo() {
|
||||
this + 1
|
||||
}
|
||||
Reference in New Issue
Block a user