summaryrefslogtreecommitdiff
path: root/test/files/neg/patmat-type-check.scala
Commit message (Collapse)AuthorAgeFilesLines
* Begone t1737...Hubert Plociniczak2011-11-021-6/+6
|
* Pattern matching on Array types, working for re...Paul Phillips2010-10-041-2/+5
| | | | | | | | | | | | | | | | | Pattern matching on Array types, working for reals. def f[T](a: Array[T]) = a match { case x: Array[Int] => x(0) case x: Array[Double] => 2 // etc. } I'd also like to thank "instantiateTypeVar" for displacing the mechanical spiders and giant squid beings which used to fill my nightmares. Now that I know true horror, I welcome the squid. Closes #2755, review by odersky.
* Tighter pattern matching hits the street.Paul Phillips2010-02-181-0/+28
is final and does not conform to the pattern, it will no longer compile. See all the exciting things you can no longer do: "bob".reverse match { case Seq('b', 'o', 'b') => true } // denied! "bob".toArray match { case Seq('b', 'o', 'b') => true } // rejected! final class Dunk def f3(x: Dunk) = x match { case Seq('b', 'o', 'b') => true } // uh-uh! And so forth. Review by odersky.