0

In Eclipse Scala sheet I get error for:

(-1 until 5).foreach {i =>    println(i)}

Errors are:

Type ';' expected but ')' found
illegal start of simple expression

but if I delete the "." after (-1 until 5) I won't get any error:

(-1 until 5) foreach {i =>    println(i)}

why is that?

Omid
  • 1,959
  • 25
  • 42

0 Answers0