Files
kotlin-fork/idea/testData/inspectionsLocal/replaceAssociateFunction/associateByToKeyAndValue/basic.kt.after
T
2019-03-11 19:33:17 +03:00

12 lines
340 B
Plaintext
Vendored

// HIGHLIGHT: INFORMATION
// PROBLEM: Replace 'associateTo' with 'associateByTo'
// FIX: Replace with 'associateByTo'
// WITH_RUNTIME
fun getKey(i: Int): Long = 1L
fun getValue(i: Int): String = ""
fun test() {
val destination = mutableMapOf<Long, String>()
listOf(1).associateByTo(destination, { getKey(it) }, { getValue(it) })
}