title: Scala compiler says "error: identifier expected but integer literal found." for () not {}
body: <p>Why does the Scala <code>2.11.0-M3</code> compiler give me <code>error: identifier expected but integer literal found.</code> when the round brackets <code>()</code> are used while it compiles fine with curly brackets <code>{}</code>?</p>
  
  <pre><code>$ scala
  Welcome to Scala version 2.11.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
  Type in expressions to have them evaluated.
  Type :help for more information.
  
  scala&gt; val s = "this is a string"
  s: String = this is a string
  
  scala&gt; s.toList map (c:Char =&gt; 1)
  &lt;console&gt;:1: error: identifier expected but integer literal found.
         s.toList map (c:Char =&gt; 1)
                                 ^
  
  scala&gt; s.toList map {c:Char =&gt; 1}
  res7: List[Int] = List(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
  </code></pre>
  
  <p>Somehow it compiles fine with the round brackets as well when the left-hand side of the anonymous function is within another pair of the round brackets. Why?</p>
  
  <pre><code>scala&gt; s.toList map ((c:Char) =&gt; 1)
  res8: List[Int] = List(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
  </code></pre>