ConvertForEachToForLoopIntention preserves comments

This commit is contained in:
Valentin Kipyatkov
2015-05-26 00:17:34 +03:00
parent 5d0b42ee71
commit fefa12b0a9
4 changed files with 24 additions and 2 deletions
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo(list: List<String?>) {
list.filter { it != null } /* filter out nulls */
.forEach<caret> { print(1..4) /* print x */ }
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo(list: List<String?>) {
for (it in list.filter { it != null } /* filter out nulls */) {
print(1..4) /* print x */
}
}