aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/patmat/Space.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-09 13:49:46 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-11-09 13:49:46 +0100
commit7332e9c1df756f6898e58231183517fefe93604d (patch)
treefdd1078db6fb2fe42e379cf3532e2a6d7e7340c1 /src/dotty/tools/dotc/transform/patmat/Space.scala
parente0839e97cac2d212aae8eebbf3f828f91a27ddab (diff)
downloaddotty-7332e9c1df756f6898e58231183517fefe93604d.tar.gz
dotty-7332e9c1df756f6898e58231183517fefe93604d.tar.bz2
dotty-7332e9c1df756f6898e58231183517fefe93604d.zip
Change `ClassicReporter` to `TestReporter` in test sources
Diffstat (limited to 'src/dotty/tools/dotc/transform/patmat/Space.scala')
-rw-r--r--src/dotty/tools/dotc/transform/patmat/Space.scala12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/transform/patmat/Space.scala b/src/dotty/tools/dotc/transform/patmat/Space.scala
index 830d0f938..8d926fcf0 100644
--- a/src/dotty/tools/dotc/transform/patmat/Space.scala
+++ b/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -12,6 +12,7 @@ import core.Symbols._
import core.StdNames._
import core.NameOps._
import core.Constants._
+import reporting.diagnostic.messages._
/** Space logic for checking exhaustivity and unreachability of pattern matching
*
@@ -586,13 +587,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
val patternSpace = cases.map(x => project(x.pat)).reduce((a, b) => Or(List(a, b)))
val uncovered = simplify(minus(Typ(selTyp, true), patternSpace))
- if (uncovered != Empty) {
- ctx.warning(
- "match may not be exhaustive.\n" +
- s"It would fail on the following input: " +
- show(uncovered), _match.pos
- )
- }
+ if (uncovered != Empty)
+ ctx.warning(PatternMatchExhaustivity(show(uncovered)), _match.pos)
}
def checkRedundancy(_match: Match): Unit = {
@@ -612,7 +608,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
val curr = project(cases(i).pat)
if (isSubspace(curr, prevs)) {
- ctx.warning("unreachable code", cases(i).body.pos)
+ ctx.warning(MatchCaseUnreachable(), cases(i).body.pos)
}
}
}