filterIsInstanceTo NOT supported
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// INTENTION_TEXT: "Replace with '+= filterIsInstance<>()'"
|
||||||
|
|
||||||
|
// decided to not generate "filterIsInstanceTo" because it either requires 2 type arguments (looks awful) or no type arguments at all (looks confusing)
|
||||||
|
|
||||||
|
fun foo(list: List<Any>, target: MutableCollection<String>) {
|
||||||
|
<caret>for (o in list) {
|
||||||
|
if (o is String) {
|
||||||
|
target.add(o)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// INTENTION_TEXT: "Replace with '+= filterIsInstance<>()'"
|
||||||
|
|
||||||
|
// decided to not generate "filterIsInstanceTo" because it either requires 2 type arguments (looks awful) or no type arguments at all (looks confusing)
|
||||||
|
|
||||||
|
fun foo(list: List<Any>, target: MutableCollection<String>) {
|
||||||
|
<caret>target += list.filterIsInstance<String>()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user