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

12 lines
345 B
Kotlin
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).<caret>associateTo(destination) { i -> getKey(i) to getValue(i) }
}