Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
42120b93b8
commit
f1e66d0654
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun getValue(i: Int): String = ""
|
||||
|
||||
fun test(b: Boolean) {
|
||||
listOf(1).<caret>associate {
|
||||
if (b) {
|
||||
it to getValue(it)
|
||||
} else {
|
||||
it to ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user