Redundant arrow: don't report on forEach call with underscore
#KT-27209 Fixed
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
// We do not report "redundant arrow" here,
|
||||
// because it's used to explicitly call forEach with unused lambda parameter
|
||||
listOf(1, 2, 3).forEach { <caret>_ -> }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun println(s: String) {}
|
||||
|
||||
fun test() {
|
||||
listOf(1, 2, 3).forEach { <caret>it -> println(it) }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun println(s: String) {}
|
||||
|
||||
fun test() {
|
||||
listOf(1, 2, 3).forEach { println(it) }
|
||||
}
|
||||
Reference in New Issue
Block a user