summaryrefslogtreecommitdiff
path: root/test/files/neg/pat_unreachable.check
Commit message (Collapse)AuthorAgeFilesLines
* SI-6120 multiple warnings at same position.Paul Phillips2013-09-271-1/+4
| | | | | An error suppresses all further warnings at the same position, but multiple warnings can be heard.
* Removed old pattern matcher.Paul Phillips2012-12-261-9/+10
|
* Better pattern matcher error message.Paul Phillips2012-08-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | For the common case when someone hasn't quite grokked the significance of lower case in a pattern match. I'd like to make all the unreachables errors, not warnings, but there may be a bug or two to clear out first. class A { def badEquals(x: Any, y: Any) = x match { case y => true case _ => false } } a.scala:3: warning: patterns after a variable pattern cannot match (SLS 8.1.1) If you intended to match against parameter y of method badEquals, you must use backticks, like: case `y` => case y => true ^ a.scala:4: warning: unreachable code due to variable pattern 'y' on line 3 case _ => false ^ two warnings found
* Lots of work hardening matching on sequences.Paul Phillips2009-07-071-0/+7
one long-standing bug which actually had a test case testing its bugginess (which is to say, when I fixed the bug, the test case failed.) This: - def doMatch4(xs:Seq[Char]) = xs match { - case Seq(x, y, _*) => x::y::Nil - case Seq(x, y, z, w) => List(z,w) // redundant! - } ...should never have compiled - which must have been recognized on some level given the "redundant!" comment, but it never made it into neg/.