RedundantLetInspection: fix false negative for references

#KT-34603 Fixed
This commit is contained in:
Dmitry Gridin
2019-10-25 22:26:03 +07:00
parent 5fc70f6cfd
commit 13e98e712e
10 changed files with 67 additions and 1 deletions
@@ -0,0 +1,3 @@
// WITH_RUNTIME
val a = 42.let<caret> { t -> t }.also { println(it) }
@@ -0,0 +1,3 @@
// WITH_RUNTIME
val a = 42.also { println(it) }
@@ -0,0 +1,3 @@
// WITH_RUNTIME
val a = 42.let<caret> { it }
@@ -0,0 +1,3 @@
// WITH_RUNTIME
val a = 42
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun Int.foo() {
let<caret> { it }
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun Int.foo() {
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun Int.foo() {
let<caret> { it }.also(::println)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun Int.foo() {
also(::println)
}