Aladdin - Scala Bugtracking
[#524] project: compiler priority: low category: bug
submitter assigned to status date submitted
Lex Martin won't fix 2006-01-27 22:05:23.0
subject automatic semicolon before close brace?
code
object foo {
  def blah: Unit = {
    val bar = 3
  }
}

what happened
oneval.scala:3 error: ';' expected but '}' found.
    val bar = 3
               ^
one error found
what expected I wish there was a priority less than "low". Anyway, it seems that this should compile.
[back to overview]
Changes of this bug report
Martin  edited on  2006-01-28 20:01:36.0
I don't think this should compile. It makes no sense for a function body to end in a definition. Even if one assumes an implicit addition of (), as in def foo { val bar = 3; () } It still makes no sense because why define `bar' when it is not used. Java works the same way, btw.