title: Syntactic sugar explanation of Scala'a unapply method
body: <p>I am getting an error in the extractor step (unapply method call).
  The error message is: Wrong number of arguments for the extractors. found 2; expected 0</p>
  <p>Can someone please help what is causing the error (where my misunderstanding is).</p>
  <pre><code>class ABC(val name:String, val age:Int)  //class is defined.
  
  object ABC{
      def apply(age:Int, name:String) = new ABC(name, age)  
      def unapply(x:ABC) = (x.name, x.age)                   
  }
  
  
  val ins = ABC(25, &quot;Joe&quot;)  //here apply method is in action.
  val ABC(x,y) = ins        //unapply is indirectly called. As per my understanding , 25 and Joe suppose to be captured in x and y respectively. But this steps gives error.
  </code></pre>