title: How does a "case" anonymous function really work in Scala?
body: <p>Dеar Scala,</p>
  
  <pre><code>scala&gt; val f1: ((Int, Int)) =&gt; Int = { case (a, b) =&gt; a + b }
  f1: ((Int, Int)) =&gt; Int = &lt;function1&gt;
  
  scala&gt; val f2: (Int, Int) =&gt; Int = { case (a, b) =&gt; a + b }
  f2: (Int, Int) =&gt; Int = &lt;function2&gt;
  </code></pre>
  
  <p>huh?!</p>
  
  <pre><code>scala&gt; f1(1, 2)
  res2: Int = 3
  </code></pre>
  
  <p>Ok...</p>
  
  <pre><code>scala&gt; def takesIntInt2Int(fun: (Int, Int) =&gt; Int) = fun(100, 200)
  takesIntInt2Int: (fun: (Int, Int) =&gt; Int)Int
  
  scala&gt; def takesTuple2Int(fun: ((Int, Int)) =&gt; Int) = fun(100, 200)
  takesTuple2Int: (fun: ((Int, Int)) =&gt; Int)Int
  
  scala&gt; takesIntInt2Int(f2)
  res4: Int = 300
  
  scala&gt; takesIntInt2Int(f1)
  &lt;console&gt;:10: error: type mismatch;
   found   : ((Int, Int)) =&gt; Int
   required: (Int, Int) =&gt; Int
                takesIntInt2Int(f1)
                                ^
  
  scala&gt; takesTuple2Int(f1)
  res6: Int = 300
  
  scala&gt; takesTuple2Int(f2)
  &lt;console&gt;:10: error: type mismatch;
   found   : (Int, Int) =&gt; Int
   required: ((Int, Int)) =&gt; Int
                takesTuple2Int(f2)
  </code></pre>
  
  <p>Right. And now, look at this!</p>
  
  <pre><code>scala&gt; takesTuple2Int { case (a, b, c) =&gt; a + b + c }
  &lt;console&gt;:9: error: constructor cannot be instantiated to expected type;
   found   : (T1, T2, T3)
   required: (Int, Int)
                takesTuple2Int { case (a, b, c) =&gt; a + b + c }
                                      ^
  
  scala&gt; takesIntInt2Int { case (a, b, c) =&gt; a + b + c }
  &lt;console&gt;:9: error: constructor cannot be instantiated to expected type;
   found   : (T1, T2, T3)
   required: (Int, Int)
                takesIntInt2Int { case (a, b, c) =&gt; a + b + c }
  </code></pre>
  
  <p>Like, <strong>srsly</strong>? o_O Both result in <code>required: (Int, Int)</code> error.</p>
  
  <p>Why then use <code>case</code> at all in such anonymous functions?</p>