match-expression in infix position

29 views
Skip to first unread message

Simon Schäfer

unread,
May 4, 2013, 5:25:53 PM5/4/13
to scala-l...@googlegroups.com
Is there a special reason why it is not possible to use a
match-expression in infix position (without surrounding it with
parentheses)?

scala> 1 match {case x => x} + 1
<console>:1: error: ';' expected but identifier found.
1 match {case x => x} + 1
^

scala> (1 match {case x => x}) + 1
res23: Int = 2
Reply all
Reply to author
Forward
0 new messages