Skip to content

Commit 3d21fc5

Browse files
committed
Partial revert of pattern matching message kinds
1 parent 9277ae6 commit 3d21fc5

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

compiler/src/dotty/tools/dotc/reporting/messages.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,8 @@ object messages {
806806
}
807807

808808
class PatternMatchExhaustivity(uncoveredFn: => String)(implicit ctx: Context)
809-
extends PatternMatchMsg(PatternMatchExhaustivityID) {
809+
extends Message(PatternMatchExhaustivityID) {
810+
val kind = "Pattern Match Exhaustivity"
810811
lazy val uncovered = uncoveredFn
811812
lazy val msg: String =
812813
em"""|${hl("match")} may not be exhaustive.
@@ -834,7 +835,8 @@ object messages {
834835
}
835836

836837
class MatchCaseUnreachable()(implicit ctx: Context)
837-
extends PatternMatchMsg(MatchCaseUnreachableID) {
838+
extends Message(MatchCaseUnreachableID) {
839+
val kind = "Match case Unreachable"
838840
lazy val msg: String = "Unreachable case"
839841
lazy val explanation: String = ""
840842
}

tests/patmat/i4225b.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10: Only null matched
1+
10: Pattern Match

tests/patmat/null.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
6: Match case Unreachable
2-
13: Only null matched
2+
13: Pattern Match
33
18: Match case Unreachable
4-
20: Only null matched
4+
20: Pattern Match

tests/patmat/t4661.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
37: Match case Unreachable
1010
38: Match case Unreachable
1111
39: Match case Unreachable
12-
40: Only null matched
12+
40: Pattern Match
1313
46: Match case Unreachable
1414
52: Match case Unreachable
15-
59: Only null matched
15+
59: Pattern Match

0 commit comments

Comments
 (0)