Checking that target collection is always the same
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'mapTo(){}'"
|
||||
import java.util.ArrayList
|
||||
|
||||
fun foo(list: List<MutableCollection<Int>>) {
|
||||
var target: MutableCollection<Int>()
|
||||
<caret>target = list.mapTo(ArrayList<Int>()) { it.size }
|
||||
|
||||
if (target.size > 100) {
|
||||
target = ArrayList<Int>()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user