arrayListOf, mutableListOf, hashSetOf and mutableSetOf supported

This commit is contained in:
Valentin Kipyatkov
2016-08-12 22:07:54 +03:00
parent 054558ad95
commit 8e6a01fe0a
11 changed files with 141 additions and 8 deletions
+10
View File
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toList()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): List<String> {
val result = arrayListOf<String>()
<caret>for (s in map.values) {
result.add(s)
}
return result
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toList()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): List<String> {
val <caret>result = map.values.toList()
return result
}
+10
View File
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toList()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): List<String> {
val result = mutableListOf<String>()
<caret>for (s in map.values) {
result.add(s)
}
return result
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toList()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): List<String> {
val <caret>result = map.values.toList()
return result
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toMutableSet()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): MutableCollection<String> {
val result = hashSetOf<String>()
<caret>for (s in map.values) {
result.add(s)
}
return result
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toMutableSet()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): MutableCollection<String> {
val <caret>result = map.values.toMutableSet()
return result
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toMutableSet()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): MutableCollection<String> {
val result = mutableSetOf<String>()
<caret>for (s in map.values) {
result.add(s)
}
return result
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'toMutableSet()'"
// IS_APPLICABLE_2: false
fun foo(map: Map<Int, String>): MutableCollection<String> {
val <caret>result = map.values.toMutableSet()
return result
}