Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection

#KT-26269 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-01-29 19:14:44 +09:00
committed by Mikhail Glukhikh
parent 42120b93b8
commit f1e66d0654
68 changed files with 1064 additions and 0 deletions
@@ -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) { i -> i to getValue(i) }
}