diff --git a/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt b/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt new file mode 100644 index 00000000000..92e20d58550 --- /dev/null +++ b/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt @@ -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, target: MutableCollection) { + for (o in list) { + if (o is String) { + target.add(o) + } + } +} \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt.after b/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt.after new file mode 100644 index 00000000000..683f488ae11 --- /dev/null +++ b/idea/testData/intentions/loopToCallChain/filterIsInstanceTo.kt.after @@ -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, target: MutableCollection) { + target += list.filterIsInstance() +} \ No newline at end of file