diff --git a/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt b/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt new file mode 100644 index 00000000000..f38419eae34 --- /dev/null +++ b/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt @@ -0,0 +1,24 @@ +// WITH_RUNTIME +import java.util.ArrayList + +fun foo(): List { + while (true) { + val result = ArrayList() + for (s in list()) { + if (s.length > 0) { + result.add(s) + } + } + + if (bar1()) continue + if (bar2()) break + + return result + } + + return emptyList() +} + +fun list() = listOf("a") +fun bar1() = true +fun bar2() = true \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt.after b/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt.after new file mode 100644 index 00000000000..632d876548f --- /dev/null +++ b/idea/testData/intentions/loopToCallChain/assignFilter_breakAndContinue.kt.after @@ -0,0 +1,19 @@ +// WITH_RUNTIME +import java.util.ArrayList + +fun foo(): List { + while (true) { + val result = list().filter { it.length > 0 } + + if (bar1()) continue + if (bar2()) break + + return result + } + + return emptyList() +} + +fun list() = listOf("a") +fun bar1() = true +fun bar2() = true \ No newline at end of file