buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Using range expression in `foreach` statement should not create a list

Open giann opened this issue 2 years ago • 0 comments

Ranges are syntaxic sugar to create list of integers. But when used in a foreach statement it should be expanded to a classic for statement:

foreach (int i in 0...n) {
    | ...
}

should be syntaxic sugar for:

for (int i = 0; i < n; i = i + 1) {
    | ...
}

giann avatar Sep 06 '23 08:09 giann