Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
42120b93b8
commit
f1e66d0654
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: Replace 'associateTo' with 'associateWithTo'
|
||||
// FIX: Replace with 'associateWithTo'
|
||||
// WITH_RUNTIME
|
||||
fun getValue(i: Int): String = ""
|
||||
|
||||
fun associateWithTo() {
|
||||
val destination = mutableMapOf<Int, String>()
|
||||
listOf(1).<caret>associateTo(destination) { Pair(it, getValue(it)) }
|
||||
}
|
||||
Reference in New Issue
Block a user