summaryrefslogtreecommitdiff
path: root/test/files/neg/patmat-type-check.scala
Commit message (Collapse)AuthorAgeFilesLines
* Cull extraneous whitespace.Paul Phillips2013-09-181-6/+6
| | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* 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.