Aladdin - Scala Bugtracking
[#555] project: compiler priority: low category: bug
submitter assigned to status date submitted
Gilles Martin fixed 2006-03-23 16:09:42.0
subject Syntactically-empty blocks vs. functionally-empty blocks
code
object Main extends Application {
  def tata = {
    def titi = {}
  }
}
what happened
main.scala:3 error: ';' expected but '}' found.
    def titi = {}
                 ^
what expected

Students not asking questions about that at exercise session.

Exactly what needs to be done is unclear, it could be either

  • No error; "def titi = {}" is valid and "tata", which is equivalent (apart from a functionally-irrelevent definition), should be too.
  • A better error message like "return value must be explicit in block with definition".
[back to overview]
Changes of this bug report
Gilles  edited on  2006-03-23 16:09:53.0
Martin  edited on  2006-03-27 23:12:41.0