#KT-4570: Convert between for loop and a forEach function call.

Issue #KT-4570.

Replaces an expression of form x.forEach { … } with for (a in x) { … }.