http://d.puremagic.com/issues/show_bug.cgi?id=596
--- Comment #9 from [email protected] 2013-02-19 16:22:06 PST --- To match classes Scala uses the standard method "unapply": http://www.scala-lang.org/node/112 object Twice { def apply(x: Int): Int = x * 2 def unapply(z: Int): Option[Int] = if (z%2 == 0) Some(z/2) else None } object TwiceTest extends Application { val x = Twice(21) x match { case Twice(n) => Console.println(n) } // prints 21 } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
