Hacker News new | past | comments | ask | show | jobs | submit login

Not sure, all of the proposed syntax changes in Dotty require `case` in pattern matching blocks. With braces how would you parse this (contrived) example?

    foo match {
      x: Bar => 
        (y: Int) => x.num + y
      x: Baz => ...
    }
With significant whitespace the first block of indented code would mark a `case` pattern, with subsequent indents belonging to the matched pattern.

With braces I suspect the `case`less version becomes more difficult to parse. Otherwise why require `case` in pattern matches?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: