Correct handling of explicit variable type

This commit is contained in:
Valentin Kipyatkov
2016-10-15 22:57:56 +03:00
parent 9326dfa048
commit 5ca7688b7c
5 changed files with 35 additions and 0 deletions
@@ -0,0 +1,11 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with '+='"
// IS_APPLICABLE_2: false
import java.util.ArrayList
fun foo(map: Map<Int, String>) {
val result: ArrayList<String> = ArrayList()
<caret>for (s in map.values) {
result.add(s)
}
}
@@ -0,0 +1,9 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with '+='"
// IS_APPLICABLE_2: false
import java.util.ArrayList
fun foo(map: Map<Int, String>) {
val result: ArrayList<String> = ArrayList()
result += map.values
}