E4112

E4112#

The usage of continue statement is invalid.

This error happens when you use a continue statement in the initialization, condition, or update statement of a loop.

错误示例#

pub fn f(x: Int, y: Int) -> Unit {
  for i = 0; i < x; i = i + 1 {
    for j = { continue }; j < y; j = j + 1 {
//            ^^^^^^^^ Error: The usage of continue statement is invalid.
        println(i + j)
    }
  }
}

建议#

Do not write continue statement in the initialization, condition, or update statement of a loop.