KT-16828: use _ when appropriate in destructure intention
This commit is contained in:
committed by
Mikhail Glukhikh
parent
32d0d7a4d5
commit
8a02ce3dc2
@@ -3,7 +3,7 @@
|
||||
data class My(val first: String, val second: Int)
|
||||
|
||||
fun foo(list: List<My>) {
|
||||
for ((first, second) in list) {
|
||||
for ((_, second) in list) {
|
||||
println(second)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val list = listOf(MyClass(1, 2, 3, 4))
|
||||
for ((a, b, c) in list) {
|
||||
for ((a, _, c) in list) {
|
||||
println("$a$c")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val map = hashMapOf(1 to 1)
|
||||
for ((key, value) in map) {
|
||||
for ((_, value) in map) {
|
||||
println(value)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user